Created
March 9, 2011 06:39
-
-
Save ClemensSahs/861785 to your computer and use it in GitHub Desktop.
so we change this
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function setRequest($request) | |
{ | |
if (is_string($request)) { | |
if (!class_exists($request)) { | |
throw new Exception('Class is not exists'); | |
} | |
$request = new $request(); | |
} | |
if (!$request instanceof Request\AbstractRequest) { | |
throw new Exception('Invalid request class'); | |
} | |
$this->_request = $request; | |
return $this; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use \Zend\Loader\Exception\InvalidArgumentException; | |
/* | |
some code | |
*/ | |
public function setRequest($request) | |
{ | |
if (is_string($request)) { | |
if (!class_exists($request)) { | |
throw new InvalidArgumentException('Class is not exists'); | |
} | |
$request = new $request(); | |
} | |
if (!$request instanceof Request\AbstractRequest) { | |
throw new InvalidArgumentException('Invalid request class'); | |
} | |
$this->_request = $request; | |
return $this; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function setRequest($request) | |
{ | |
if (is_string($request)) { | |
if (!class_exists($request)) { | |
\Zend\Loader::loadClass($request); | |
} | |
$request = new $request(); | |
} | |
if (!$request instanceof Request\AbstractRequest) { | |
throw new Exception('Invalid request class'); | |
} | |
$this->_request = $request; | |
return $this; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment