claviska / SimpleImage

A PHP class that makes working with images and GD as simple as possible.
MIT License
1.38k stars 382 forks source link

getExif(): Return value must be of type ?array, bool returned #323

Closed crazy-weasel closed 1 year ago

crazy-weasel commented 1 year ago

Hi!

With the PHP8 upgrade of the library and the introduction of return value type declarations, the getExif-method can cause an error if the exif_read_data-function, that populates the property, returns false.

The return value type declaration should be changed to array|bool|null or the handling of the return value should reflect the possibility of the value false.

Greetings, Alex

claviska commented 1 year ago

Thanks, that makes sense. Anyone want to take a stab at a PR?