getkirby.com
getkirby.com copied to clipboard
Replace dynamic property with passing a callback to the sort() method
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.
Is this ready to be reviewed?
@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 Could we maybe still start to merge this PR for this article?
I have already fixed this in another PR now