From ccb0a0c3900f86c0bfc50f1757d1b8a6d8e32500 Mon Sep 17 00:00:00 2001 From: James Brooks Date: Thu, 14 Jun 2018 21:10:35 +0100 Subject: [PATCH] Remove unused array_numeric_sort --- app/helpers.php | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/app/helpers.php b/app/helpers.php index 6f6d01e6..c3bb1aae 100644 --- a/app/helpers.php +++ b/app/helpers.php @@ -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.