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