From 5867d477bee5d964e6e104a352b208a1e76090ac Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Fri, 30 Aug 2013 12:51:06 +0200 Subject: [PATCH] Use call_user_func for PHP < 5.4 compatability and accept __invoke --- src/Composer/EventDispatcher/EventDispatcher.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Composer/EventDispatcher/EventDispatcher.php b/src/Composer/EventDispatcher/EventDispatcher.php index acf8d2f2c..912d4eaea 100644 --- a/src/Composer/EventDispatcher/EventDispatcher.php +++ b/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);