minor #27110 [Messenger] Reset traceable buses (ogizanagi)

This PR was merged into the 4.1-dev branch.

Discussion
----------

[Messenger] Reset traceable buses

| Q             | A
| ------------- | ---
| Branch?       | master <!-- see below -->
| Bug fix?      | yes
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | N/A   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | N/A

So the dispatched messages list is empty on new requests without rebooting the kernel.

Commits
-------

c68887e1e8 [Messenger] Reset traceable buses
This commit is contained in:
Samuel ROZE 2018-05-01 18:38:15 +01:00
commit daf7ac064b
2 changed files with 8 additions and 0 deletions

View File

@ -67,6 +67,9 @@ class MessengerDataCollector extends DataCollector implements LateDataCollectorI
public function reset()
{
$this->data = array();
foreach ($this->traceableBuses as $traceableBus) {
$traceableBus->reset();
}
}
private function collectMessage(string $busName, array $tracedMessage)

View File

@ -52,4 +52,9 @@ class TraceableMessageBus implements MessageBusInterface
{
return $this->dispatchedMessages;
}
public function reset()
{
$this->dispatchedMessages = array();
}
}