1 | <?php |
||
7 | trait Counters |
||
8 | { |
||
9 | /** |
||
10 | * Counts maximum array depth recursively |
||
11 | * |
||
12 | * @param array $array |
||
13 | * |
||
14 | * @return int |
||
15 | */ |
||
16 | public static function countMaxDepth(array $array) |
||
29 | |||
30 | /** |
||
31 | * Counts maximum array depth iteratively |
||
32 | * |
||
33 | * @param array $array |
||
34 | * |
||
35 | * @return int |
||
36 | */ |
||
37 | public static function countMaxDepthIterative(array $array) |
||
62 | |||
63 | /** |
||
64 | * Counts maximum array depth |
||
65 | * |
||
66 | * @param mixed $potentialArray |
||
67 | * @param int $depth |
||
68 | * |
||
69 | * @return int |
||
70 | * @throws InvalidArgumentException |
||
71 | */ |
||
72 | public static function countMinDepth($potentialArray, $depth = 0) |
||
94 | } |