Skip to content

Commit

Permalink
Remove unused array_numeric_sort
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrooksuk committed Jun 14, 2018
1 parent 0e1a5aa commit ccb0a0c
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions app/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,30 +122,6 @@ function color_contrast($hexcolor)
}
}

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.
Expand Down

0 comments on commit ccb0a0c

Please sign in to comment.