Skip to content

Conversation

@gkisiel
Copy link
Contributor

@gkisiel gkisiel commented Sep 7, 2023

This PR makes the Arr::sortRecursiveDesc() method static, which it should be.

@gkisiel gkisiel changed the title [10.x] Change Arr:sortRecursiveDesc() method to static. [10.x] Change Arr::sortRecursiveDesc() method to static. Sep 7, 2023
@driesvints
Copy link
Member

Please add more reasoning why this is needed.

@gkisiel
Copy link
Contributor Author

gkisiel commented Sep 7, 2023

Using the folllowing code

$array = [
    ['Roman', 'Taylor', 'Li'],
    ['PHP', 'Ruby', 'JavaScript'],
    ['one' => 1, 'two' => 2, 'three' => 3],
];
 
$sorted = Arr::sortRecursiveDesc($array);

causes PHP parser error:

Non-static method Illuminate\Support\Arr::sortRecursiveDesc() cannot be called statically

The Arr::sortRecursiveDesc() method references another Arr::sortRecursive() method, which is a static method.

Edit: Was wrong example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants