Conditions | 4 |
Paths | 4 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 4.25 |
Changes | 0 |
1 | <?php |
||
17 | 50 | public function equals(ScriptWitnessInterface $witness): bool |
|
18 | { |
||
19 | 50 | $nStack = count($this); |
|
20 | 50 | if ($nStack !== count($witness)) { |
|
21 | return false; |
||
22 | } |
||
23 | |||
24 | 50 | for ($i = 0; $i < $nStack; $i++) { |
|
25 | 22 | if (false === $this->offsetGet($i)->equals($witness->offsetGet($i))) { |
|
26 | return false; |
||
27 | } |
||
28 | } |
||
29 | |||
30 | 50 | return true; |
|
31 | } |
||
41 |