Cache icon indicating copy to clipboard operation
Cache copied to clipboard

fix: Required parameter $function follows optional parameter $conditions [PHP8]

Open mkosiedowski opened this issue 5 years ago • 1 comments

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

mkosiedowski avatar Nov 15 '20 10:11 mkosiedowski

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.

mahagr avatar Dec 02 '20 11:12 mahagr