Conditions | 9 |
Paths | 4 |
Total Lines | 19 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 90 |
Changes | 0 |
1 | <?php |
||
16 | protected function checkFixedArray($elements, $count, $atLeast = false) |
||
17 | { |
||
18 | if ( |
||
19 | empty($elements) || |
||
20 | !is_array($elements) || |
||
21 | (!$atLeast && count($elements) !== $count) || |
||
22 | ($atLeast && count($elements) < $count) |
||
23 | ) { |
||
24 | return false; |
||
25 | } |
||
26 | |||
27 | for ($i=0; $i < $count; $i++) { |
||
28 | if (!isset($elements[$i])) { |
||
29 | return false; |
||
30 | } |
||
31 | } |
||
32 | |||
33 | return true; |
||
34 | } |
||
35 | } |
||
36 |