Conditions | 4 |
Paths | 4 |
Total Lines | 21 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 12 |
CRAP Score | 4 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
18 | 3 | public function appendToDeepRelationship(array $through, array $foreignKeys, array $localKeys, int $position): array |
|
|
|||
19 | { |
||
20 | 3 | foreach ($this->throughParents as $throughParent) { |
|
21 | 3 | $segments = explode(' as ', $throughParent->getTable()); |
|
22 | |||
23 | 3 | $class = get_class($throughParent); |
|
24 | |||
25 | 3 | if (isset($segments[1])) { |
|
26 | 1 | $class .= ' as '.$segments[1]; |
|
27 | 3 | } elseif ($throughParent instanceof Pivot) { |
|
28 | 1 | $class = $throughParent->getTable(); |
|
29 | } |
||
30 | |||
31 | 3 | $through[] = $class; |
|
32 | } |
||
33 | |||
34 | 3 | $foreignKeys = array_merge($foreignKeys, $this->foreignKeys); |
|
35 | |||
36 | 3 | $localKeys = array_merge($localKeys, $this->localKeys); |
|
37 | |||
38 | 3 | return [$through, $foreignKeys, $localKeys]; |
|
39 | } |
||
41 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.