| Total Complexity | 8 |
| Total Lines | 52 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | trait EventManagerAwareTrait |
||
| 19 | { |
||
| 20 | /** |
||
| 21 | * @var EventsManager |
||
| 22 | */ |
||
| 23 | protected $eventsManager = null; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * set event manager. |
||
| 27 | * |
||
| 28 | * @param EventsManager $eventsManager |
||
| 29 | */ |
||
| 30 | public function setEventsManager(EventsManager $manager) |
||
| 31 | { |
||
| 32 | $this->eventsManager = $manager; |
||
| 33 | } |
||
| 34 | |||
| 35 | /** |
||
| 36 | * return event manager. |
||
| 37 | * |
||
| 38 | * @return EventsManager | null |
||
| 39 | */ |
||
| 40 | public function getEventsManager() |
||
| 41 | { |
||
| 42 | $di = Di::getDefault(); |
||
| 43 | |||
| 44 | if (!empty($this->eventsManager)) { |
||
| 45 | $manager = $this->eventsManager; |
||
| 46 | } elseif ($di->has('eventsManager')) { |
||
| 47 | $manager = $di->get('eventsManager'); |
||
| 48 | } |
||
| 49 | |||
| 50 | if (isset($manager) && $manager instanceof EventsManager) { |
||
| 51 | return $manager; |
||
| 52 | } |
||
| 53 | |||
| 54 | return null; |
||
| 55 | } |
||
| 56 | |||
| 57 | /** |
||
| 58 | * Checking if event manager is defined - fire event. |
||
| 59 | * |
||
| 60 | * @param string $event |
||
| 61 | * @param object $source |
||
| 62 | * @param mixed $data |
||
| 63 | * @param boolean $cancelable |
||
| 64 | * |
||
| 65 | */ |
||
| 66 | public function fire($event, $source, $data = null, $cancelable = true) |
||
| 70 | } |
||
| 71 | } |
||
| 72 | } |
||
| 73 |
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