Skip to content

Commit 6e8b883

Browse files
xurshudyanVolodya Khurshudyan
andauthored
Add sortRecursiveDesc() method (#46945)
Co-authored-by: Volodya Khurshudyan <[email protected]>
1 parent d800f9e commit 6e8b883

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/Illuminate/Collections/Arr.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -770,6 +770,18 @@ public static function sortRecursive($array, $options = SORT_REGULAR, $descendin
770770
return $array;
771771
}
772772

773+
/**
774+
* Recursively sort an array by keys and values in descending order.
775+
*
776+
* @param array $array
777+
* @param int $options
778+
* @return array
779+
*/
780+
public function sortRecursiveDesc($array, $options = SORT_REGULAR)
781+
{
782+
return $this->sortRecursive($array, $options, true);
783+
}
784+
773785
/**
774786
* Conditionally compile classes from an array into a CSS class list.
775787
*

0 commit comments

Comments
 (0)