updated packages

This commit is contained in:
2019-05-18 09:06:43 +00:00
parent 901d16349e
commit e9487fa58a
2025 changed files with 30366 additions and 49653 deletions

View File

@@ -39,8 +39,8 @@ class TraceableEventDispatcher implements TraceableEventDispatcherInterface
$this->dispatcher = $dispatcher;
$this->stopwatch = $stopwatch;
$this->logger = $logger;
$this->wrappedListeners = array();
$this->orphanedEvents = array();
$this->wrappedListeners = [];
$this->orphanedEvents = [];
}
/**
@@ -164,10 +164,10 @@ class TraceableEventDispatcher implements TraceableEventDispatcherInterface
public function getCalledListeners()
{
if (null === $this->callStack) {
return array();
return [];
}
$called = array();
$called = [];
foreach ($this->callStack as $listener) {
list($eventName) = $this->callStack->getInfo();
@@ -186,14 +186,14 @@ class TraceableEventDispatcher implements TraceableEventDispatcherInterface
$allListeners = $this->getListeners();
} catch (\Exception $e) {
if (null !== $this->logger) {
$this->logger->info('An exception was thrown while getting the uncalled listeners.', array('exception' => $e));
$this->logger->info('An exception was thrown while getting the uncalled listeners.', ['exception' => $e]);
}
// unable to retrieve the uncalled listeners
return array();
return [];
}
$notCalled = array();
$notCalled = [];
foreach ($allListeners as $eventName => $listeners) {
foreach ($listeners as $listener) {
$called = false;
@@ -216,7 +216,7 @@ class TraceableEventDispatcher implements TraceableEventDispatcherInterface
}
}
uasort($notCalled, array($this, 'sortNotCalledListeners'));
uasort($notCalled, [$this, 'sortNotCalledListeners']);
return $notCalled;
}
@@ -229,7 +229,7 @@ class TraceableEventDispatcher implements TraceableEventDispatcherInterface
public function reset()
{
$this->callStack = null;
$this->orphanedEvents = array();
$this->orphanedEvents = [];
}
/**
@@ -279,7 +279,7 @@ class TraceableEventDispatcher implements TraceableEventDispatcherInterface
$this->wrappedListeners[$eventName][] = $wrappedListener;
$this->dispatcher->removeListener($eventName, $listener);
$this->dispatcher->addListener($eventName, $wrappedListener, $priority);
$this->callStack->attach($wrappedListener, array($eventName));
$this->callStack->attach($wrappedListener, [$eventName]);
}
}
@@ -297,17 +297,13 @@ class TraceableEventDispatcher implements TraceableEventDispatcherInterface
$this->dispatcher->addListener($eventName, $listener->getWrappedListener(), $priority);
if (null !== $this->logger) {
$context = array('event' => $eventName, 'listener' => $listener->getPretty());
$context = ['event' => $eventName, 'listener' => $listener->getPretty()];
}
if ($listener->wasCalled()) {
if (null !== $this->logger) {
$this->logger->debug('Notified event "{event}" to listener "{listener}".', $context);
}
if (!isset($this->called[$eventName])) {
$this->called[$eventName] = new \SplObjectStorage();
}
} else {
$this->callStack->detach($listener);
}