-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Open
Description
Symfony version(s) affected
7.3
Description
When using --profile
, debug
section is always empty.

Reason for this is that debug.dump_listener
is not aware that data_collector.dump
exists, and that DataCollector
is not called. If I replace DataDumperInterface $dumper
argument from debug.dump_listener
with data_collector.dump
instead, collected data is registered in the profiler as expected.
How to reproduce
- Create a new Symfony project
- Install profiler and debug dependencies (
composer require --dev debug profiler
) - Create any command with
dump('foo')
inexecute
method - Call created command with
--profiler
option
Possible Solution
Simply adding data_collector.dump
as an additional dependency to debug.dump_listener
seems to work, although it's possible that it should only be called if --profile
was actually passed. Not sure about other side effects this might have.
Here is the result I got once I swapped dumper in debug.dump_listener
with data_collector.dump
(which removed the dump output from console, of course).
# vendor/symfony/debug-bundle/Resources/config/services.php
$services
->set('debug.dump_listener', DumpListener::class)
->args([
service('var_dumper.cloner'),
# Replaced:
# service('var_dumper.cli_dumper'),
service('data_collector.dump'),
null,
])
->tag('kernel.event_subscriber');

Additional Context
No response
alongosz