Browse Source

Use call_user_func for PHP < 5.4 compatability and accept __invoke

Nils Adermann 11 years ago
parent
commit
5867d477be
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/Composer/EventDispatcher/EventDispatcher.php

+ 2 - 2
src/Composer/EventDispatcher/EventDispatcher.php

@@ -119,8 +119,8 @@ class EventDispatcher
         $listeners = $this->getListeners($event);
 
         foreach ($listeners as $callable) {
-            if ((is_array($callable) && is_callable($callable)) || $callable instanceof Closure) {
-                $callable($event);
+            if (!is_string($callable) && is_callable($callable)) {
+                call_user_func($callable, $event);
             } elseif ($this->isPhpScript($callable)) {
                 $className = substr($callable, 0, strpos($callable, '::'));
                 $methodName = substr($callable, strpos($callable, '::') + 2);