From 0e0848bc27b1fda79f4b8e228ab34505ecb2a02d Mon Sep 17 00:00:00 2001 From: Jonas Elfering Date: Fri, 3 Nov 2023 10:29:38 +0100 Subject: [PATCH] Fix missing `profile` option for console commands Fixes https://github.com/symfony/symfony/issues/52433 --- .../FrameworkBundle/EventListener/ConsoleProfilerListener.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/EventListener/ConsoleProfilerListener.php b/src/Symfony/Bundle/FrameworkBundle/EventListener/ConsoleProfilerListener.php index f9a55a62e23b9..d3fc3810631b6 100644 --- a/src/Symfony/Bundle/FrameworkBundle/EventListener/ConsoleProfilerListener.php +++ b/src/Symfony/Bundle/FrameworkBundle/EventListener/ConsoleProfilerListener.php @@ -59,7 +59,8 @@ public static function getSubscribedEvents(): array public function initialize(ConsoleCommandEvent $event): void { - if (!$event->getInput()->getOption('profile')) { + $input = $event->getInput(); + if (!$input->hasOption('profile') || !$input->getOption('profile')) { $this->profiler->disable(); return;