Skip to content

Commit

Permalink
Don't pass unneeded argument in event dispatcher.
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Dec 15, 2016
1 parent f71ecb0 commit c54b09b
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/Illuminate/Events/Dispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ protected function sortListeners($eventName)
/**
* Register an event listener with the dispatcher.
*
* @param mixed $listener
* @param string|\Closure $listener
* @return mixed
*/
public function makeListener($listener)
Expand All @@ -336,16 +336,14 @@ public function makeListener($listener)
/**
* Create a class based listener using the IoC container.
*
* @param mixed $listener
* @param string $listener
* @return \Closure
*/
public function createClassListener($listener)
{
$container = $this->container;

return function () use ($listener, $container) {
return function () use ($listener) {
return call_user_func_array(
$this->createClassCallable($listener, $container), func_get_args()
$this->createClassCallable($listener), func_get_args()
);
};
}
Expand All @@ -354,17 +352,16 @@ public function createClassListener($listener)
* Create the class based event callable.
*
* @param string $listener
* @param \Illuminate\Container\Container $container
* @return callable
*/
protected function createClassCallable($listener, $container)
protected function createClassCallable($listener)
{
list($class, $method) = $this->parseClassCallable($listener);

if ($this->handlerShouldBeQueued($class)) {
return $this->createQueuedHandlerCallable($class, $method);
} else {
return [$container->make($class), $method];
return [$this->container->make($class), $method];
}
}

Expand Down

0 comments on commit c54b09b

Please sign in to comment.