1 | <?php declare(strict_types=1); |
||
22 | final class LaravelEventStore implements EventStore |
||
23 | { |
||
24 | /** @var Serializer */ |
||
25 | private $serializer; |
||
26 | |||
27 | /** @var string */ |
||
28 | private $eventStoreTableName; |
||
29 | |||
30 | /** @var Connection */ |
||
31 | private $db; |
||
32 | |||
33 | /** |
||
34 | * @param DatabaseManager $databaseManager |
||
35 | * @param Serializer $serializer |
||
36 | * @param string $eventStoreConnectionName |
||
37 | * @param string $eventStoreTableName |
||
38 | */ |
||
39 | public function __construct( |
||
49 | |||
50 | /** |
||
51 | * @param string $id |
||
52 | * @return DomainEventStream |
||
53 | * @throws EventStreamNotFound |
||
54 | */ |
||
55 | public function load(string $id) : DomainEventStream |
||
74 | |||
75 | /** |
||
76 | * @param string $id |
||
77 | * @param DomainEventStream $eventStream |
||
78 | * @throws \PDOException |
||
79 | * @throws \SmoothPhp\EventStore\DuplicateAggregatePlayhead |
||
80 | * @throws \Illuminate\Database\QueryException |
||
81 | */ |
||
82 | public function append(string $id, DomainEventStream $eventStream) : void |
||
99 | |||
100 | /** |
||
101 | * @param array $eventRow |
||
102 | * @throws DuplicateAggregatePlayhead |
||
103 | * @throws \PDOException |
||
104 | */ |
||
105 | private function insertEvent(array $eventRow) : void |
||
116 | |||
117 | /** |
||
118 | * @param \stdClass |
||
119 | * @return DomainMessage |
||
120 | */ |
||
121 | private function deserializeEvent($row) : DomainMessage |
||
131 | |||
132 | /** |
||
133 | * @param string[] $eventTypes |
||
134 | * @return int |
||
135 | */ |
||
136 | public function getEventCountByTypes(array $eventTypes) : int |
||
142 | |||
143 | /** |
||
144 | * @param string[] $eventTypes |
||
145 | * @param int $take |
||
146 | * @return \Generator |
||
147 | */ |
||
148 | public function getEventsByType(array $eventTypes, int $take) : \Generator |
||
170 | |||
171 | /** |
||
172 | * @param DomainMessage $domainMessage |
||
173 | * @return array |
||
174 | */ |
||
175 | private function domainMessageToArray(DomainMessage $domainMessage) : array |
||
186 | |||
187 | /** |
||
188 | * @param string $streamId |
||
189 | */ |
||
190 | public function deleteStream(string $streamId) : void |
||
196 | } |
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.
In this case you can add the
@ignore
PhpDoc annotation to the duplicate definition and it will be ignored.