diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/messenger.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/messenger.html.twig index d8befbbf8d..50dfbb9d3a 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/messenger.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/messenger.html.twig @@ -55,7 +55,8 @@ .message-bus .badge.status-some-errors { line-height: 16px; border-bottom: 2px solid #B0413E; } - .message-item .sf-toggle-content.sf-toggle-visible { display: table-row-group; } + .message-item tbody.sf-toggle-content.sf-toggle-visible { display: table-row-group; } + td.message-bus-dispatch-caller { background: #f1f2f3; } {% endblock %} @@ -100,12 +101,12 @@ {% macro render_bus_messages(messages, showBus = false) %} {% set discr = random() %} - {% for i, dispatchCall in messages %} + {% for dispatchCall in messages %}
{{ profiler_dump(dispatchCall.message.type) }} @@ -122,7 +123,31 @@ | |
---|---|
+ In
+ {% set caller = dispatchCall.caller %}
+ {% if caller.line %}
+ {% set link = caller.file|file_link(caller.line) %}
+ {% if link %}
+ {{ caller.name }}
+ {% else %}
+ {{ caller.name }}
+ {% endif %}
+ {% else %}
+ {{ caller.name }}
+ {% endif %}
+ line {{ caller.line }}
+
+
+
+
+
+ {{ caller.file|file_excerpt(caller.line) }}
+
+ |
+ |
Bus | diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/profiler.css.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/profiler.css.twig index f9bc41d6a1..eb66f63681 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/profiler.css.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/profiler.css.twig @@ -913,6 +913,27 @@ table.logs .metadata { background: rgba(255, 255, 153, 0.5); } +{# Messenger panel + ========================================================================= #} + +#collector-content .message-bus .trace { + border: 1px solid #DDD; + background: #FFF; + padding: 10px; + margin: 0.5em 0; + overflow: auto; +} +#collector-content .message-bus .trace { + font-size: 12px; +} +#collector-content .message-bus .trace li { + margin-bottom: 0; + padding: 0; +} +#collector-content .message-bus .trace li.selected { + background: rgba(255, 255, 153, 0.5); +} + {# Dump panel ========================================================================= #} #collector-content .sf-dump { diff --git a/src/Symfony/Component/Messenger/DataCollector/MessengerDataCollector.php b/src/Symfony/Component/Messenger/DataCollector/MessengerDataCollector.php index ed98f4cfa4..d71f16d544 100644 --- a/src/Symfony/Component/Messenger/DataCollector/MessengerDataCollector.php +++ b/src/Symfony/Component/Messenger/DataCollector/MessengerDataCollector.php @@ -97,6 +97,7 @@ class MessengerDataCollector extends DataCollector implements LateDataCollectorI 'type' => new ClassStub(\get_class($message)), 'value' => $message, ), + 'caller' => $tracedMessage['caller'], ); if (array_key_exists('result', $tracedMessage)) { diff --git a/src/Symfony/Component/Messenger/Tests/DataCollector/MessengerDataCollectorTest.php b/src/Symfony/Component/Messenger/Tests/DataCollector/MessengerDataCollectorTest.php index d88593e3e7..7c4fafa340 100644 --- a/src/Symfony/Component/Messenger/Tests/DataCollector/MessengerDataCollectorTest.php +++ b/src/Symfony/Component/Messenger/Tests/DataCollector/MessengerDataCollectorTest.php @@ -59,6 +59,7 @@ class MessengerDataCollectorTest extends TestCase public function getHandleTestData() { + $file = __FILE__; $messageDump = <<