Total Complexity | 8 |
Total Lines | 46 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | class InotifyConsumerFactory |
||
12 | { |
||
13 | private $inotifyProxy; |
||
14 | /** |
||
15 | * @var EventDispatcherInterface |
||
16 | */ |
||
17 | private $eventDispatcher; |
||
18 | |||
19 | public function __construct( |
||
20 | InotifyProxyInterface $inotifyProxy = null, |
||
21 | EventDispatcherInterface $eventDispatcher = null |
||
22 | ) { |
||
23 | $this->inotifyProxy = $inotifyProxy; |
||
24 | $this->eventDispatcher = $eventDispatcher; |
||
25 | |||
26 | if (null === $eventDispatcher) { |
||
27 | $this->eventDispatcher = new EventDispatcher(); |
||
28 | } |
||
29 | if (null === $inotifyProxy) { |
||
30 | $this->inotifyProxy = new InotifyProxy(); |
||
31 | } |
||
32 | } |
||
33 | |||
34 | /** |
||
35 | * @param WatchedResourceCollection|WatchedResource[] $collection |
||
36 | */ |
||
37 | public function consume(WatchedResourceCollection $collection): void |
||
38 | { |
||
39 | foreach ($collection as $resource) { |
||
40 | $this->inotifyProxy->addWatch($resource); |
||
|
|||
41 | } |
||
42 | |||
43 | while ($events = $this->inotifyProxy->read()) { |
||
44 | foreach ($events as $event) { |
||
45 | $this->eventDispatcher->dispatch($event); |
||
46 | } |
||
47 | } |
||
48 | |||
49 | $this->inotifyProxy->closeWatchers(); |
||
50 | } |
||
51 | |||
52 | public function registerSubscriber(EventSubscriberInterface $eventSubscribers): self |
||
57 | } |
||
58 | } |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.