From fb12ed42a9869acc61f94aa622f16946dea21c59 Mon Sep 17 00:00:00 2001 From: Mathieu TUDISCO Date: Mon, 5 Jun 2017 20:08:03 +0200 Subject: [PATCH 1/2] Remove the type hint callable for `array_sort` As `Arr::sort()` can accept a string, we should not force a callable here, and have to accept a string (with dot notation) too! --- src/Illuminate/Support/helpers.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Illuminate/Support/helpers.php b/src/Illuminate/Support/helpers.php index 51d86b9b97d5..9290a899d68d 100755 --- a/src/Illuminate/Support/helpers.php +++ b/src/Illuminate/Support/helpers.php @@ -264,13 +264,13 @@ function array_set(&$array, $key, $value) if (! function_exists('array_sort')) { /** - * Sort the array using the given callback. + * Sort the array using the given callback or "dot" notation. * * @param array $array - * @param callable $callback + * @param callable|string $callback * @return array */ - function array_sort($array, callable $callback) + function array_sort($array, $callback) { return Arr::sort($array, $callback); } From 396930dd7bce0899fe04b8106f8e3c642f663e2c Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Mon, 5 Jun 2017 14:22:37 -0500 Subject: [PATCH 2/2] Update helpers.php --- src/Illuminate/Support/helpers.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Support/helpers.php b/src/Illuminate/Support/helpers.php index 9290a899d68d..66d1d9d27e9a 100755 --- a/src/Illuminate/Support/helpers.php +++ b/src/Illuminate/Support/helpers.php @@ -264,7 +264,7 @@ function array_set(&$array, $key, $value) if (! function_exists('array_sort')) { /** - * Sort the array using the given callback or "dot" notation. + * Sort the array by the given callback or attribute name. * * @param array $array * @param callable|string $callback