| Conditions | 1 |
| Paths | 1 |
| Total Lines | 9 |
| Code Lines | 2 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 3 |
| CRAP Score | 1 |
| Changes | 1 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 64 | 8 | public function isAssoc(array &$array): bool |
|
| 65 | { |
||
| 66 | // Keys of the array |
||
| 67 | 8 | $keys = array_keys($array); |
|
| 68 | |||
| 69 | // If the array keys of the keys match the keys, then the array must |
||
| 70 | // not be associative (e.g. the keys array looked like {0:0, 1:1...}). |
||
| 71 | |||
| 72 | 8 | return array_keys($keys) !== $keys; |
|
| 73 | } |
||
| 75 |