Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Lines | 14 |
Ratio | 100 % |
Changes | 0 |
1 | <?php |
||
38 | public function modify(AbstractQuery $query) |
||
39 | { |
||
40 | foreach ($this->children as $child) { |
||
41 | if (!$child instanceof ResultModifier) { |
||
42 | throw new InvalidArgumentException(sprintf( |
||
43 | 'Child passed to ResultModifierCollection must be an instance of %s, but instance of %s found', |
||
44 | ResultModifier::class, |
||
45 | get_class($child) |
||
46 | )); |
||
47 | } |
||
48 | |||
49 | $child->modify($query); |
||
50 | } |
||
51 | } |
||
52 | } |
||
53 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.