1 | <?php |
||
13 | class SnapshotService extends Service |
||
14 | { |
||
15 | /** @var null|SnapshotSource */ |
||
16 | private $source = null; |
||
17 | |||
18 | /** |
||
19 | * AggregationService constructor. |
||
20 | * |
||
21 | * @param SnapshotSource $source |
||
22 | */ |
||
23 | public function __construct(SnapshotSource $source) |
||
27 | |||
28 | /** |
||
29 | * @return SnapshotSource |
||
30 | */ |
||
31 | public function getSource(): SnapshotSource |
||
35 | |||
36 | /** |
||
37 | * Select or create new Aggregation (you must save entity by yourself). |
||
38 | * |
||
39 | * @param string $hash |
||
40 | * @return SnapshotRecord |
||
41 | */ |
||
42 | public function getByHash(string $hash): SnapshotRecord |
||
53 | |||
54 | /** |
||
55 | * Count occurrence by intervals. |
||
56 | * |
||
57 | * @param SnapshotRecord $snapshot |
||
58 | * @param IncidentSource $source |
||
59 | * @return array |
||
60 | */ |
||
61 | public function countOccurred(SnapshotRecord $snapshot, IncidentSource $source): array |
||
70 | |||
71 | /** |
||
72 | * @param SnapshotRecord $aggregation |
||
73 | * @param IncidentSource $source |
||
74 | * @param \DateInterval $interval |
||
75 | * @return int |
||
76 | */ |
||
77 | private function countIntervalOccurred( |
||
89 | |||
90 | /** |
||
91 | * Creates unique hash to allow aggregating snapshots. |
||
92 | * |
||
93 | * @param SnapshotInterface $snapshot |
||
94 | * @return string |
||
95 | */ |
||
96 | public static function makeHash(SnapshotInterface $snapshot): string |
||
100 | |||
101 | /** |
||
102 | * @param SnapshotRecord $snapshot |
||
103 | */ |
||
104 | public function delete(SnapshotRecord $snapshot) |
||
118 | } |
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.