Conditions | 4 |
Paths | 4 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 20 |
Changes | 0 |
1 | <?php |
||
35 | private function valueExists(NodeValueInterface $value, int $outerIndex): bool |
||
36 | { |
||
37 | foreach ($this->values as $innerIndex => $addedValue) { |
||
38 | if (!$addedValue->getPath()->equals($value->getPath())) { |
||
39 | continue; |
||
40 | } |
||
41 | $addedOuterIndex = $this->outerIndexes[$innerIndex]; |
||
42 | if ($outerIndex == $addedOuterIndex) { |
||
43 | return true; |
||
44 | } |
||
45 | |||
46 | throw new Exception\ValueInListWithAnotherOuterIndexException($value, $addedOuterIndex, $outerIndex); |
||
47 | } |
||
48 | |||
49 | return false; |
||
50 | } |
||
52 |