refactoring.
This commit is contained in:
@@ -60,7 +60,7 @@ class Caller {
|
||||
return $this->finish($route, $response);
|
||||
}
|
||||
|
||||
if ( ! is_null($response = $route->call($this->container)))
|
||||
if ( ! is_null($response = $route->call()))
|
||||
{
|
||||
if (is_array($response)) $response = $this->delegator->delegate($route, $response);
|
||||
|
||||
@@ -83,7 +83,7 @@ class Caller {
|
||||
{
|
||||
$before = array_merge(array('before'), $route->filters('before'));
|
||||
|
||||
return $this->filterer->filter($before, array($this->container), true);
|
||||
return $this->filterer->filter($before, array(), true);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -99,7 +99,7 @@ class Caller {
|
||||
{
|
||||
if ( ! $response instanceof Response) $response = new Response($response);
|
||||
|
||||
$this->filterer->filter(array_merge($route->filters('after'), array('after')), array($this->container, $response));
|
||||
$this->filterer->filter(array_merge($route->filters('after'), array('after')), array($response));
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
@@ -52,17 +52,15 @@ class Route {
|
||||
/**
|
||||
* Call the route closure.
|
||||
*
|
||||
* If no closure is defined for the route, null will be returned. The IoC container instance will be
|
||||
* passed to the route closure so it has access to all of the framework components.
|
||||
* If no closure is defined for the route, null will be returned.
|
||||
*
|
||||
* @param Container $container
|
||||
* @return mixed
|
||||
*/
|
||||
public function call(Container $container)
|
||||
public function call()
|
||||
{
|
||||
if (is_null($closure = $this->find_closure())) return;
|
||||
|
||||
return call_user_func_array($closure, array_merge($this->parameters, array($container)));
|
||||
return call_user_func_array($closure, $this->parameters);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user