minor #13276 [3.0][FrameworkBundle] Fixed TextDescriptor::describeEventDispatcherListeners() (saro0h)
This PR was merged into the 3.0-dev branch.
Discussion
----------
[3.0][FrameworkBundle] Fixed TextDescriptor::describeEventDispatcherListeners()
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | ~
| License | MIT
| Doc PR | ~
Commits
-------
1b25018
[FrameworkBundle] Fixed TextDescriptor::describeEventDispatcherListeners()
This commit is contained in:
commit
b11429a4bd
@ -310,6 +310,8 @@ class TextDescriptor extends Descriptor
|
|||||||
foreach ($registeredListeners as $order => $listener) {
|
foreach ($registeredListeners as $order => $listener) {
|
||||||
$table->addRow(array(sprintf('#%d', $order + 1), $this->formatCallable($listener)));
|
$table->addRow(array(sprintf('#%d', $order + 1), $this->formatCallable($listener)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$table->render();
|
||||||
} else {
|
} else {
|
||||||
ksort($registeredListeners);
|
ksort($registeredListeners);
|
||||||
foreach ($registeredListeners as $eventListened => $eventListeners) {
|
foreach ($registeredListeners as $eventListened => $eventListeners) {
|
||||||
@ -320,10 +322,9 @@ class TextDescriptor extends Descriptor
|
|||||||
foreach ($eventListeners as $order => $eventListener) {
|
foreach ($eventListeners as $order => $eventListener) {
|
||||||
$table->addRow(array(sprintf('#%d', $order + 1), $this->formatCallable($eventListener)));
|
$table->addRow(array(sprintf('#%d', $order + 1), $this->formatCallable($eventListener)));
|
||||||
}
|
}
|
||||||
|
$table->render();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$table->render();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,6 +1,12 @@
|
|||||||
<info>[event_dispatcher]</info> Registered listeners by event
|
<info>[event_dispatcher]</info> Registered listeners by event
|
||||||
|
|
||||||
<info>[Event]</info> event1
|
<info>[Event]</info> event1
|
||||||
|
+-------+-------------------+
|
||||||
|
|[32m Order [39m|[32m Callable [39m|
|
||||||
|
+-------+-------------------+
|
||||||
|
| #1 | global_function() |
|
||||||
|
| #2 | \Closure() |
|
||||||
|
+-------+-------------------+
|
||||||
|
|
||||||
<info>[Event]</info> event2
|
<info>[Event]</info> event2
|
||||||
+-------+-----------------------------------------------------------------------------------+
|
+-------+-----------------------------------------------------------------------------------+
|
||||||
|
Reference in New Issue
Block a user