Skip to content

Commit

Permalink
[5.4] Remove the callable type hint for array_sort. (#19483)
Browse files Browse the repository at this point in the history
* 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!

* Update helpers.php
  • Loading branch information
mathieutu authored and taylorotwell committed Jun 5, 2017
1 parent b2d9b46 commit cb48cf5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Illuminate/Support/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 by the given callback or attribute name.
*
* @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);
}
Expand Down

0 comments on commit cb48cf5

Please sign in to comment.