1 | <?php |
||
7 | class OutboxPersister |
||
8 | { |
||
9 | /** |
||
10 | * @var LogicalConnection |
||
11 | */ |
||
12 | private $connection; |
||
13 | |||
14 | /** |
||
15 | * @var string |
||
16 | */ |
||
17 | private $endpointsTableName; |
||
18 | |||
19 | /** |
||
20 | * @var string |
||
21 | * |
||
22 | */ |
||
23 | private $messagesTableName; |
||
24 | |||
25 | /** |
||
26 | * @param LogicalConnection $connection |
||
27 | * @param string $messagesTableName |
||
28 | * @param string $endpointsTableName |
||
29 | */ |
||
30 | 13 | public function __construct( |
|
39 | |||
40 | /** |
||
41 | * Attempts to reconnect once if disconnected. |
||
42 | * |
||
43 | * @param int $endpointId |
||
44 | * @param string $messageId |
||
45 | * |
||
46 | * @return array |
||
47 | * @throws \Exception |
||
48 | */ |
||
49 | 6 | public function get($endpointId, $messageId) |
|
70 | |||
71 | /** |
||
72 | * @param int $endpointId |
||
73 | * @param array $outboxRecord |
||
74 | * |
||
75 | * @throws \Exception |
||
76 | */ |
||
77 | 5 | public function store($endpointId, array $outboxRecord) |
|
89 | |||
90 | /** |
||
91 | * Attempts to reconnect once if disconnected. |
||
92 | * |
||
93 | * @param int $endpointId |
||
94 | * @param string $messageId |
||
95 | * |
||
96 | * @throws \Exception |
||
97 | */ |
||
98 | 4 | public function markAsDispatched($endpointId, $messageId) |
|
115 | |||
116 | /** |
||
117 | * Initiates the transaction |
||
118 | * Attempts to reconnect once if disconnected. |
||
119 | * |
||
120 | * @throws \Exception |
||
121 | */ |
||
122 | 1 | public function beginTransaction() |
|
130 | |||
131 | /** |
||
132 | * Commits the transaction |
||
133 | * |
||
134 | * Does not attempt to reconnect if disconnected because the transaction would be broken anyway. |
||
135 | * Reconnection should be done by rollBack. |
||
136 | * |
||
137 | * @return void |
||
138 | */ |
||
139 | public function commit() |
||
143 | |||
144 | /** |
||
145 | * Rolls back the transaction. |
||
146 | * Attempts to reconnect once if disconnected. |
||
147 | * |
||
148 | * @throws \Exception |
||
149 | */ |
||
150 | 3 | public function rollBack() |
|
158 | |||
159 | /** |
||
160 | * Attempts to reconnect once if disconnected. |
||
161 | * |
||
162 | * @param \DateTime $dateTime |
||
163 | * |
||
164 | * @throws \Exception |
||
165 | */ |
||
166 | 2 | public function removeEntriesOlderThan(\DateTime $dateTime) |
|
174 | |||
175 | /** |
||
176 | * @param string $endpointName |
||
177 | * |
||
178 | * @return int |
||
179 | */ |
||
180 | 2 | public function fetchOrGenerateEndpointId($endpointName) |
|
205 | |||
206 | /** |
||
207 | * @param string $messageId |
||
208 | * |
||
209 | * @return string |
||
210 | */ |
||
211 | 8 | private function stripDashes($messageId) |
|
215 | } |
||
216 |
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.