getkirby.com icon indicating copy to clipboard operation
getkirby.com copied to clipboard

Replace dynamic property with passing a callback to the sort() method

Open ovenum opened this issue 11 months ago • 2 comments

As mentioned on the Discord Server, the Sorting Cookbook article currently makes use of dynamic properties that will cause a deprecation warning in PHP 8.2. Support for dynamic properties is set to be removed in PHP 9.

This pull requests replaces the use of dynamic properties in the article with a callback function. I’m not quite sure if this is how the sort() method should be used and the guide would require more examples how to change sorting order.

ovenum avatar Feb 25 '24 09:02 ovenum

Is this ready to be reviewed?

distantnative avatar Mar 01 '24 21:03 distantnative

@distantnative We have a few other places where map() needs to be replaced, this is on my list.

https://github.com/getkirby/getkirby.com/issues/2229

texnixe avatar Mar 02 '24 08:03 texnixe

@texnixe Could we maybe still start to merge this PR for this article?

bastianallgeier avatar Mar 20 '24 12:03 bastianallgeier

I have already fixed this in another PR now

texnixe avatar Mar 23 '24 16:03 texnixe