8000 [Console][WebProfiler] Profiled commands don't contain `dump` data · Issue #61971 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Console][WebProfiler] Profiled commands don't contain dump data #61971

@Steveb-p

Description

@Steveb-p

Symfony version(s) affected

7.3

Description

When using --profile, debug section is always empty.

Image

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') in execute 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');
Image

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0