From a8e6c46bb1d169863419cf952619ee261b927810 Mon Sep 17 00:00:00 2001 From: abelhooge Date: Sun, 12 Jul 2020 11:56:47 +0200 Subject: [PATCH] Made events more verbose. --- src/FuzeWorks/Events.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/FuzeWorks/Events.php b/src/FuzeWorks/Events.php index 492c396..50876a6 100644 --- a/src/FuzeWorks/Events.php +++ b/src/FuzeWorks/Events.php @@ -224,16 +224,16 @@ class Events //Check for listeners in this priority if (isset(self::$listeners[$eventName][$priority])) { $listeners = self::$listeners[$eventName][$priority]; - Logger::newLevel('Found listeners with priority '.Priority::getPriority($priority)); + Logger::newLevel('Listeners with priority '.Priority::getPriority($priority)); //Fire the event to each listener foreach ($listeners as $callbackArray) { // @codeCoverageIgnoreStart $callback = $callbackArray[0]; - if (is_callable($callback)) { - Logger::newLevel('Firing function'); - } elseif (!is_string($callback[0])) { + if (is_array($callback)) { Logger::newLevel('Firing '.get_class($callback[0]).'->'.$callback[1]); - } else { + } elseif (is_callable($callback)) { + Logger::newLevel('Firing function'); + } else { Logger::newLevel('Firing '.implode('->', $callback)); } // @codeCoverageIgnoreEnd