Skip to content

Commit 1618e06

Browse files
committedFeb 23, 2019
Merge branch '4.2'
* 4.2: (26 commits) Apply php-cs-fixer rule for array_key_exists() [Cache] fix warming up cache.system and apcu [Security] Change FormAuthenticator if condition handles multi-byte characters in autocomplete speed up tests running them without debug flag [Translations] added missing Croatian validators Fix getItems() performance issue with RedisCluster (php-redis) [VarDumper] Keep a ref to objects to ensure their handle cannot be reused while cloning IntegerType: reject submitted non-integer numbers be keen to newcomers [HttpKernel] Fix possible infinite loop of exceptions fixed CS [Validator] Added missing translations for Afrikaans do not validate non-submitted form fields in PATCH requests Update usage example in ArrayInput doc block. [Console] Prevent ArgvInput::getFirstArgument() from returning an option value [Validator] Fixed duplicate UUID fixed CS [EventDispatcher] Fix unknown priority Avoid mutating the Finder when building the iterator ...
2 parents 63dd1cf + 3354d2e commit 1618e06

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed
 

‎Debug/WrappedListener.php

+6-2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ class WrappedListener
3030
private $dispatcher;
3131
private $pretty;
3232
private $stub;
33+
private $priority;
3334
private static $hasClassStub;
3435

3536
public function __construct(callable $listener, ?string $name, Stopwatch $stopwatch, EventDispatcherInterface $dispatcher = null)
@@ -98,19 +99,22 @@ public function getInfo($eventName)
9899

99100
return [
100101
'event' => $eventName,
101-
'priority' => null !== $this->dispatcher ? $this->dispatcher->getListenerPriority($eventName, $this->listener) : null,
102+
'priority' => null !== $this->priority ? $this->priority : (null !== $this->dispatcher ? $this->dispatcher->getListenerPriority($eventName, $this->listener) : null),
102103
'pretty' => $this->pretty,
103104
'stub' => $this->stub,
104105
];
105106
}
106107

107108
public function __invoke(Event $event, $eventName, EventDispatcherInterface $dispatcher)
108109
{
110+
$dispatcher = $this->dispatcher ?: $dispatcher;
111+
109112
$this->called = true;
113+
$this->priority = $dispatcher->getListenerPriority($eventName, $this->listener);
110114

111115
$e = $this->stopwatch->start($this->name, 'event_listener');
112116

113-
($this->optimizedListener)($event, $eventName, $this->dispatcher ?: $dispatcher);
117+
($this->optimizedListener)($event, $eventName, $dispatcher);
114118

115119
if ($e->isStarted()) {
116120
$e->stop();

‎GenericEvent.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public function setArguments(array $args = [])
111111
*/
112112
public function hasArgument($key)
113113
{
114-
return array_key_exists($key, $this->arguments);
114+
return \array_key_exists($key, $this->arguments);
115115
}
116116

117117
/**

0 commit comments

Comments
 (0)