1 | <?php |
||
27 | class HasManyRelation extends MultipleRelation implements \IteratorAggregate, \Countable |
||
28 | { |
||
29 | use LookupTrait; |
||
30 | |||
31 | /** |
||
32 | * Records deleted from list. Potentially pre-schedule command? |
||
33 | * |
||
34 | * @var RecordInterface[] |
||
35 | */ |
||
36 | private $deletedInstances = []; |
||
37 | |||
38 | /** |
||
39 | * {@inheritdoc} |
||
40 | * |
||
41 | * @throws RelationException |
||
42 | */ |
||
43 | public function setRelated($value) |
||
71 | |||
72 | /** |
||
73 | * Iterate over deleted instances. |
||
74 | * |
||
75 | * @return \ArrayIterator |
||
76 | */ |
||
77 | public function getDeleted() |
||
81 | |||
82 | /** |
||
83 | * Add new record into entity set. Attention, usage of this method WILL load relation data |
||
84 | * unless partial. |
||
85 | * |
||
86 | * @param RecordInterface $record |
||
87 | * |
||
88 | * @return self |
||
89 | * |
||
90 | * @throws RelationException |
||
91 | */ |
||
92 | public function add(RecordInterface $record): self |
||
99 | |||
100 | /** |
||
101 | * Delete one record, strict compaction, make sure exactly same instance is given. |
||
102 | * |
||
103 | * @param RecordInterface $record |
||
104 | * |
||
105 | * @return self |
||
106 | * |
||
107 | * @throws RelationException |
||
108 | */ |
||
109 | public function delete(RecordInterface $record): self |
||
127 | |||
128 | /** |
||
129 | * {@inheritdoc} |
||
130 | */ |
||
131 | public function queueCommands(ContextualCommandInterface $parentCommand): CommandInterface |
||
157 | |||
158 | /** |
||
159 | * @param ContextualCommandInterface $parentCommand |
||
160 | * @param RecordInterface $instance |
||
161 | * |
||
162 | * @return CommandInterface |
||
163 | */ |
||
164 | protected function queueRelated( |
||
183 | |||
184 | /** |
||
185 | * Fetch data from database. Lazy load. |
||
186 | * |
||
187 | * @return array |
||
188 | */ |
||
189 | protected function loadRelated(): array |
||
198 | |||
199 | /** |
||
200 | * Create outer selector for a given inner key value. |
||
201 | * |
||
202 | * @param mixed $innerKey |
||
203 | * |
||
204 | * @return RecordSelector |
||
205 | */ |
||
206 | protected function createSelector($innerKey): RecordSelector |
||
223 | } |
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.