[FrameworkBundle] Make debug:event-dispatcher search case insensitive

This commit is contained in:
Javier Eguiluz 2021-04-26 16:11:51 +02:00
parent 896f4a6eb6
commit 1e4c7d9c5d

View File

@ -123,9 +123,10 @@ EOF
private function searchForEvent(EventDispatcherInterface $dispatcher, $needle): array private function searchForEvent(EventDispatcherInterface $dispatcher, $needle): array
{ {
$output = []; $output = [];
$lcNeedle = strtolower($needle);
$allEvents = array_keys($dispatcher->getListeners()); $allEvents = array_keys($dispatcher->getListeners());
foreach ($allEvents as $event) { foreach ($allEvents as $event) {
if (str_contains($event, $needle)) { if (str_contains(strtolower($event), $lcNeedle)) {
$output[] = $event; $output[] = $event;
} }
} }