Fix Exception message in ControllerManager
This commit is contained in:
parent
6d5f186728
commit
7764a278c4
@ -152,7 +152,6 @@ class ControllerManager
|
|||||||
public function getMethodArguments(array $path, $controller, $method)
|
public function getMethodArguments(array $path, $controller, $method)
|
||||||
{
|
{
|
||||||
$r = new \ReflectionObject($controller);
|
$r = new \ReflectionObject($controller);
|
||||||
|
|
||||||
$arguments = array();
|
$arguments = array();
|
||||||
foreach ($r->getMethod($method)->getParameters() as $param) {
|
foreach ($r->getMethod($method)->getParameters() as $param) {
|
||||||
if (array_key_exists($param->getName(), $path)) {
|
if (array_key_exists($param->getName(), $path)) {
|
||||||
@ -160,7 +159,7 @@ class ControllerManager
|
|||||||
} elseif ($param->isDefaultValueAvailable()) {
|
} elseif ($param->isDefaultValueAvailable()) {
|
||||||
$arguments[] = $param->getDefaultValue();
|
$arguments[] = $param->getDefaultValue();
|
||||||
} else {
|
} else {
|
||||||
throw new \RuntimeException(sprintf('Controller "%s::%s()" requires that you provide a value for the "$%s" argument (because there is no default value or because there is a non optional argument after this one).', $controller, $method, $param->getName()));
|
throw new \RuntimeException(sprintf('Controller "%s::%s()" requires that you provide a value for the "$%s" argument (because there is no default value or because there is a non optional argument after this one).', get_class($controller), $method, $param->getName()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user