Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 057844d

Browse filesBrowse files
committed
minor #45326 [EventDispatcher] Remove unused variables (mttsch)
This PR was submitted for the 4.4 branch but it was squashed and merged into the 6.1 branch instead. Discussion ---------- [EventDispatcher] Remove unused variables | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | | License | MIT | Doc PR | The removed variable in `EventDispatcher::sortListeners()` has not been used since d6a594b#diff-27b473156e98208bb0270a426172f4c20c45595ca7babfe8fd653a817bd0741cL230 and the removed variable in `TraceableEventDispatcher::getListenerPriority()` has never been used: 79b71c0#diff-bcbd20f9d547cfc56597d5f4f3a611b06c5f3b69f610e5e2b8922401dad1fbf3R110-R114 Commits ------- 4045168 [EventDispatcher] Remove unused variables
2 parents 0758e59 + 4045168 commit 057844d
Copy full SHA for 057844d

File tree

2 files changed

+2
-2
lines changed
Filter options

2 files changed

+2
-2
lines changed

‎src/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcher.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcher.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public function getListenerPriority(string $eventName, callable|array $listener)
108108
// we might have wrapped listeners for the event (if called while dispatching)
109109
// in that case get the priority by wrapper
110110
if (isset($this->wrappedListeners[$eventName])) {
111-
foreach ($this->wrappedListeners[$eventName] as $index => $wrappedListener) {
111+
foreach ($this->wrappedListeners[$eventName] as $wrappedListener) {
112112
if ($wrappedListener->getWrappedListener() === $listener) {
113113
return $this->dispatcher->getListenerPriority($eventName, $wrappedListener);
114114
}

‎src/Symfony/Component/EventDispatcher/EventDispatcher.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/EventDispatcher/EventDispatcher.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ private function sortListeners(string $eventName)
240240
$this->sorted[$eventName] = [];
241241

242242
foreach ($this->listeners[$eventName] as &$listeners) {
243-
foreach ($listeners as $k => &$listener) {
243+
foreach ($listeners as &$listener) {
244244
if (\is_array($listener) && isset($listener[0]) && $listener[0] instanceof \Closure && 2 >= \count($listener)) {
245245
$listener[0] = $listener[0]();
246246
$listener[1] ??= '__invoke';

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.