Remove unused array_numeric_sort

This commit is contained in:
James Brooks
2018-06-14 21:10:35 +01:00
parent 0e1a5aa0b9
commit ccb0a0c390

View File

@@ -122,30 +122,6 @@ if (!function_exists('color_contrast')) {
}
}
if (!function_exists('array_numeric_sort')) {
/**
* Numerically sort an array based on a specific key.
*
* @param array $array
* @param string $key
*
* @return array
*/
function array_numeric_sort(array $array = [], $key = 'order')
{
uasort($array, function ($a, $b) use ($key) {
$a = array_get($a, $key, PHP_INT_MAX);
$b = array_get($b, $key, PHP_INT_MAX);
$default = PHP_MAJOR_VERSION < 7 ? 1 : 0;
return $a < $b ? -1 : ($a === $b ? $default : 1);
});
return $array;
}
}
if (!function_exists('cachet_route')) {
/**
* Generate a URL to a named route, which resides in a given domain.