@@ -240,7 +240,7 @@ |
||
| 240 | 240 | } |
| 241 | 241 | |
| 242 | 242 | if ($matching_function === null) { |
| 243 | - throw new InvalidArgumentException("Method {$method} doesn't exist"); |
|
| 243 | + throw new InvalidArgumentException("method {$method} doesn't exist"); |
|
| 244 | 244 | } |
| 245 | 245 | |
| 246 | 246 | // asort in PHP5 reverses equals ("arsort" doen't mess up for some reason) |
@@ -215,7 +215,9 @@ discard block |
||
| 215 | 215 | $direction = self::getSortDirection(); |
| 216 | 216 | return function($a, $b) use ($direction, $callable) { |
| 217 | 217 | $result = $callable($a, $b); |
| 218 | - if ($result === 0) return $direction; |
|
| 218 | + if ($result === 0) { |
|
| 219 | + return $direction; |
|
| 220 | + } |
|
| 219 | 221 | return $result; |
| 220 | 222 | }; |
| 221 | 223 | } |
@@ -663,8 +665,12 @@ discard block |
||
| 663 | 665 | */ |
| 664 | 666 | private static function arr_depth($array) |
| 665 | 667 | { |
| 666 | - if (empty($array) && is_array($array)) return 0; |
|
| 667 | - if (!self::arr_is_collection($array)) return null; |
|
| 668 | + if (empty($array) && is_array($array)) { |
|
| 669 | + return 0; |
|
| 670 | + } |
|
| 671 | + if (!self::arr_is_collection($array)) { |
|
| 672 | + return null; |
|
| 673 | + } |
|
| 668 | 674 | |
| 669 | 675 | $depth = 0; |
| 670 | 676 | $child = array_shift($array); |
@@ -250,6 +250,10 @@ discard block |
||
| 250 | 250 | } |
| 251 | 251 | |
| 252 | 252 | /* Transforms the incoming calls to native calls */ |
| 253 | + |
|
| 254 | + /** |
|
| 255 | + * @param Arrgh $object |
|
| 256 | + */ |
|
| 253 | 257 | private static function invoke($method, $args, $object = null) |
| 254 | 258 | { |
| 255 | 259 | self::getSortDirection(); |
@@ -318,6 +322,11 @@ discard block |
||
| 318 | 322 | } |
| 319 | 323 | |
| 320 | 324 | /* Handles special case: asort - In PHP5 reverses equals ("arsort" doen't mess up for some reason) */ |
| 325 | + |
|
| 326 | + /** |
|
| 327 | + * @param string|null $matching_handler |
|
| 328 | + * @param string $matching_function |
|
| 329 | + */ |
|
| 321 | 330 | private static function handleCaseAsort(&$matching_handler, &$matching_function, &$post_handler, &$args) |
| 322 | 331 | { |
| 323 | 332 | $matching_function = "uasort"; |
@@ -327,6 +336,11 @@ discard block |
||
| 327 | 336 | /* Handles special case: array_column - Native array_column filters away null values. |
| 328 | 337 | * That means you cannot use array_column for multisort since array size no longer matches. |
| 329 | 338 | * This version of array_column returns null if the column is missing. */ |
| 339 | + |
|
| 340 | + /** |
|
| 341 | + * @param string|null $matching_handler |
|
| 342 | + * @param string $matching_function |
|
| 343 | + */ |
|
| 330 | 344 | private static function handleCaseArrayColumn(&$matching_handler, &$matching_function, &$post_handler, &$args) |
| 331 | 345 | { |
| 332 | 346 | $matching_handler = "_rotateRight"; |
@@ -633,6 +647,10 @@ discard block |
||
| 633 | 647 | } |
| 634 | 648 | |
| 635 | 649 | /* arr_get: Find next node by index */ |
| 650 | + |
|
| 651 | + /** |
|
| 652 | + * @param integer $plug_index |
|
| 653 | + */ |
|
| 636 | 654 | private static function _arr_get_traverse_next_node_index($data, $plug_index) |
| 637 | 655 | { |
| 638 | 656 | // Adjust negative index |
@@ -708,7 +726,7 @@ discard block |
||
| 708 | 726 | * Partion the input based on the result of the callback function. |
| 709 | 727 | * |
| 710 | 728 | * @param array $array A collection |
| 711 | - * @param \Closeure $callable A callable returning true or false depending on which way to partion the element—left or right. |
|
| 729 | + * @param Closure $callable A callable returning true or false depending on which way to partion the element—left or right. |
|
| 712 | 730 | * @return array An array with two arrays—left and right: [left, right] |
| 713 | 731 | */ |
| 714 | 732 | private static function arr_partition($array, Closure $callable) |