Commit e29c91ed authored by Fabien Potencier's avatar Fabien Potencier

added an exception when a method does not exist to ease debugging

parent 3fd92830
......@@ -74,6 +74,10 @@ class Controller
public function __call($method, $arguments)
{
if (!method_exists($this->route, $method)) {
throw new \BadMethodCallException(sprintf('Method "%s::%s" does not exist.', get_class($this->route), $method));
}
call_user_func_array(array($this->route, $method), $arguments);
return $this;
......
......@@ -112,6 +112,10 @@ class ControllerCollection
public function __call($method, $arguments)
{
if (!method_exists($this->defaultRoute, $method)) {
throw new \BadMethodCallException(sprintf('Method "%s::%s" does not exist.', get_class($this->defaultRoute), $method));
}
call_user_func_array(array($this->defaultRoute, $method), $arguments);
foreach ($this->controllers as $controller) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment