dustpress icon indicating copy to clipboard operation
dustpress copied to clipboard

Replace mixed return type with #[\ReturnTypeWillChange]

Open jaakkolehtonen opened this issue 1 year ago • 0 comments

Heya,

Use of mixed return type bumps PHP version requirement to >= 8.1, while the rest of the code is compatible with PHP >= 7.1. To maintain compatibility and suppress deprecation notices in PHP 8.1+, I've added the #[\ReturnTypeWillChange] attribute to the offsetGet method.

This attribute is used to indicate a planned change to the returned type, as PHP 9 will most likely enforce return types for interface methods like offsetGet. This ensures compatibility with PHP >= 7.1 while preparing for stricter type requirements in future PHP versions.

jaakkolehtonen avatar Dec 05 '24 10:12 jaakkolehtonen