refactoring.

This commit is contained in:
Taylor Otwell
2011-09-06 23:29:19 -05:00
parent 16716097c6
commit ed9e04db6f
9 changed files with 174 additions and 24 deletions

View File

@@ -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;
}

View File

@@ -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);
}
/**