| Total Complexity | 7 |
| Total Lines | 45 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 14 | class Util |
||
| 15 | { |
||
| 16 | /** |
||
| 17 | * Test if array is an associative array |
||
| 18 | * |
||
| 19 | * Note that this function will return true if an array is empty. Meaning |
||
| 20 | * empty arrays will be treated as if they are associative arrays. |
||
| 21 | * |
||
| 22 | * @param array<mixed> $arr |
||
| 23 | * |
||
| 24 | * @return bool |
||
| 25 | * |
||
| 26 | * @psalm-pure |
||
| 27 | */ |
||
| 28 | 9 | public static function isAssoc(array $arr): bool |
|
| 31 | } |
||
| 32 | |||
| 33 | /** |
||
| 34 | * Merge contents from one associtative array to another |
||
| 35 | * |
||
| 36 | * @param mixed $to |
||
| 37 | * @param mixed $from |
||
| 38 | * @param bool $clobber |
||
| 39 | * |
||
| 40 | * @return mixed |
||
| 41 | * |
||
| 42 | * @psalm-pure |
||
| 43 | */ |
||
| 44 | 27 | public static function mergeAssocArray($to, $from, $clobber = true) |
|
| 61 |