Cache
Cache copied to clipboard
fix: Required parameter $function follows optional parameter $conditions [PHP8]
Hi! I've found this issue while testing my project with PHP 8. Required parameters after optional parameters in function/method signatures are deprecated in PHP 8
This is not a perfect solution, because the code will still throw an exception if the $function is passed as null, but I did not want to break backwards compatibility in the interface
Looks like I missed your fix. See https://github.com/Gregwar/Cache/pull/34 which does it by opposite way.
My take on this is that having default value before required parameter has no effect and the default value gets ignored. Interface break can be handled by inceasing version number of the library.