TestSymfonyEventBus::dispatch()
last analyzed

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
c 0
b 0
f 0
eloc 4
nc 2
nop 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Gember\MessageBusSymfony\Test\TestDoubles;
6
7
use Symfony\Component\Messenger\Envelope;
8
use Symfony\Component\Messenger\Exception\ExceptionInterface;
9
use Symfony\Component\Messenger\MessageBusInterface;
10
use Exception;
11
12
final class TestSymfonyEventBus implements MessageBusInterface
13
{
14
    public bool $isCalled;
15
16
    public function dispatch(object $message, array $stamps = []): Envelope
17
    {
18
        $this->isCalled = true;
19
20
        if ($message instanceof TestEventThrowingException) {
0 ignored issues
show
Bug introduced by
The type Gember\MessageBusSymfony...tEventThrowingException was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
21
            throw new class extends Exception implements ExceptionInterface {};
22
        }
23
24
        return new Envelope($message);
25
    }
26
}
27