Skip to content

Commit cb48cf5

Browse files
mathieututaylorotwell
authored andcommitted
[5.4] Remove the callable type hint for array_sort. (#19483)
* 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
1 parent b2d9b46 commit cb48cf5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Illuminate/Support/helpers.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -264,13 +264,13 @@ function array_set(&$array, $key, $value)
264264

265265
if (! function_exists('array_sort')) {
266266
/**
267-
* Sort the array using the given callback.
267+
* Sort the array by the given callback or attribute name.
268268
*
269269
* @param array $array
270-
* @param callable $callback
270+
* @param callable|string $callback
271271
* @return array
272272
*/
273-
function array_sort($array, callable $callback)
273+
function array_sort($array, $callback)
274274
{
275275
return Arr::sort($array, $callback);
276276
}

0 commit comments

Comments
 (0)