doyolabs /
behat-code-coverage
| 1 | <?php |
||
| 2 | |||
| 3 | |||
| 4 | namespace Doyo\Behat\Coverage\Bridge\Symfony; |
||
| 5 | |||
| 6 | use Symfony\Component\EventDispatcher\EventDispatcher as SymfonyEventDispatcher; |
||
| 7 | use Symfony\Component\EventDispatcher\EventSubscriberInterface; |
||
| 8 | |||
| 9 | /** |
||
| 10 | * Maintain backward compatibility with symfony version |
||
| 11 | * |
||
| 12 | * @package Doyo\Behat\Coverage\Bridge\Symfony |
||
| 13 | */ |
||
| 14 | class EventDispatcher |
||
| 15 | { |
||
| 16 | private $version = '4.2'; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @var SymfonyEventDispatcher |
||
| 20 | */ |
||
| 21 | private $dispatcher; |
||
| 22 | |||
| 23 | 1 | public function __construct() |
|
| 24 | { |
||
| 25 | 1 | $dispatcher = new SymfonyEventDispatcher(); |
|
| 26 | 1 | $r = new \ReflectionObject($dispatcher); |
|
| 27 | 1 | $params = $r->getMethod('dispatch')->getParameters(); |
|
| 28 | |||
| 29 | 1 | if('event' === $params[0]->getName()){ |
|
| 30 | 1 | $this->version = '4.3'; |
|
| 31 | } |
||
| 32 | |||
| 33 | 1 | $this->dispatcher = $dispatcher; |
|
| 34 | } |
||
| 35 | |||
| 36 | 1 | public function addSubscriber(EventSubscriberInterface $subscriber) |
|
| 37 | { |
||
| 38 | 1 | $this->dispatcher->addSubscriber($subscriber); |
|
| 39 | } |
||
| 40 | |||
| 41 | /** |
||
| 42 | * @param Event $event |
||
| 43 | * @param string $eventName |
||
| 44 | * |
||
| 45 | * @return \Symfony\Component\EventDispatcher\Event|\Symfony\Contract\EventDispatcher\Event |
||
|
0 ignored issues
–
show
|
|||
| 46 | */ |
||
| 47 | 1 | public function dispatch($event, $eventName = null) |
|
| 48 | { |
||
| 49 | 1 | $dispatcher = $this->dispatcher; |
|
| 50 | 1 | if('4.2' === $this->version){ |
|
| 51 | return $dispatcher->dispatch($eventName, $event); |
||
|
0 ignored issues
–
show
|
|||
| 52 | } |
||
| 53 | 1 | return $dispatcher->dispatch($event, $eventName); |
|
| 54 | } |
||
| 55 | } |
||
| 56 | |||
| 57 |
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:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths