Skip to content

Commit 1882d26

Browse files
committed
bug symfony#40951 [FrameworkBundle] Make debug:event-dispatcher search case insensitive (javiereguiluz)
This PR was merged into the 5.3-dev branch. Discussion ---------- [FrameworkBundle] Make debug:event-dispatcher search case insensitive | Q | A | ------------- | --- | Branch? | 5.x | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - I was playing with the new features of `debug:event-dispatcher` and I thought that making the new search feature case insensitive could be better: ### Before ``` $ php bin/console debug:event-dispatcher mailer [WARNING] The event "mailer" does not have any registered listeners. ``` ### After ``` $ php bin/console debug:event-dispatcher mailer Registered Listeners of Event Dispatcher "debug.event_dispatcher" for "Symfony\Component\Mailer\Event\MessageEvent" Event ========================================================================================================================= ------- --------------------------------------------------------------------------- ---------- Order Callable Priority ------- --------------------------------------------------------------------------- ---------- #1 Symfony\Component\Mailer\EventListener\MessageListener::onMessage() 0 #2 Symfony\Component\Mailer\EventListener\EnvelopeListener::onMessage() -255 #3 Symfony\Component\Mailer\EventListener\MessageLoggerListener::onMessage() -255 ------- --------------------------------------------------------------------------- ---------- ``` Commits ------- 1e4c7d9 [FrameworkBundle] Make debug:event-dispatcher search case insensitive
2 parents 32534fb + 1e4c7d9 commit 1882d26

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Symfony/Bundle/FrameworkBundle/Command/EventDispatcherDebugCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int
123123
private function searchForEvent(EventDispatcherInterface $dispatcher, $needle): array
124124
{
125125
$output = [];
126+
$lcNeedle = strtolower($needle);
126127
$allEvents = array_keys($dispatcher->getListeners());
127128
foreach ($allEvents as $event) {
128-
if (str_contains($event, $needle)) {
129+
if (str_contains(strtolower($event), $lcNeedle)) {
129130
$output[] = $event;
130131
}
131132
}

0 commit comments

Comments
 (0)