php-imagine / Imagine

PHP Object Oriented image manipulation library
https://imagine.readthedocs.io
Other
4.42k stars 530 forks source link

Update min required PHP version and fix deprecation warnings #845

Closed stepozer closed 1 year ago

stepozer commented 1 year ago

Right now minimal supported PHP version is 8.0:

https://www.php.net/supported-versions.php

I suggest up minimal PHP version to 7.0 or 7.4 and fix this warnings that is I actually get in PHP 8.2:

1x: Method "ArrayAccess::offsetExists()" might add "bool" as a native return type declaration in the future. Do the same in implementation "Imagine\Imagick\Layers" now to avoid errors or add an explicit @return annotation to suppress this message.
1x: Method "ArrayAccess::offsetGet()" might add "mixed" as a native return type declaration in the future. Do the same in implementation "Imagine\Imagick\Layers" now to avoid errors or add an explicit @return annotation to suppress this message.
1x: Method "ArrayAccess::offsetSet()" might add "void" as a native return type declaration in the future. Do the same in implementation "Imagine\Imagick\Layers" now to avoid errors or add an explicit @return annotation to suppress this message.
1x: Method "ArrayAccess::offsetUnset()" might add "void" as a native return type declaration in the future. Do the same in implementation "Imagine\Imagick\Layers" now to avoid errors or add an explicit @return annotation to suppress this message.
1x: Method "Countable::count()" might add "int" as a native return type declaration in the future. Do the same in implementation "Imagine\Imagick\Layers" now to avoid errors or add an explicit @return annotation to suppress this message.
1x: Method "Iterator::current()" might add "mixed" as a native return type declaration in the future. Do the same in implementation "Imagine\Imagick\Layers" now to avoid errors or add an explicit @return annotation to suppress this message.
1x: Method "Iterator::key()" might add "mixed" as a native return type declaration in the future. Do the same in implementation "Imagine\Imagick\Layers" now to avoid errors or add an explicit @return annotation to suppress this message.
1x: Method "Iterator::next()" might add "void" as a native return type declaration in the future. Do the same in implementation "Imagine\Imagick\Layers" now to avoid errors or add an explicit @return annotation to suppress this message.
1x: Method "Iterator::rewind()" might add "void" as a native return type declaration in the future. Do the same in implementation "Imagine\Imagick\Layers" now to avoid errors or add an explicit @return annotation to suppress this message.
1x: Method "Iterator::valid()" might add "bool" as a native return type declaration in the future. Do the same in implementation "Imagine\Imagick\Layers" now to avoid errors or add an explicit @return annotation to suppress this message.

If you need I can create PR for it

mlocati commented 1 year ago

What about https://github.com/php-imagine/Imagine/pull/846?

stepozer commented 1 year ago

@mlocati tested this changes on my local project (changed files into the same approach) and it is works for me (no warnings anymore). Can you please merge it into master and push a new version?

Thank you!

mlocati commented 1 year ago

Can you please merge it into master and push a new version?

Done!