Repository navigation
Drop imagedestroy() calls deprecated in PHP 8.5 - #14
Merged
Merged
Conversation
imagedestroy() has had no effect since PHP 8.0 and PHP 8.5 deprecates it, so every re-encoded tile logged a deprecation. The encode op now just releases its reference, the tests no longer call it, and PHPUnit fails on deprecations so the 8.5 CI job catches the next one.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
imagedestroy()has had no effect since PHP 8.0 and PHP 8.5 deprecates it, so on PHP 8.5 every tile that went through theencodeop loggedFunction imagedestroy() is deprecated since 8.5. The op now releases itsGdImagereference withunset(). The tests no longer callimagedestroy().phpunit.xmlsetsfailOnDeprecation, so the 8.5 CI job fails on the next deprecation. Before this change it passed with "OK, but there were issues".The rest of the package is clean:
php -d error_reporting=E_ALL -lpasses on PHP 8.2.35, 8.5.4 and 8.5.12. A grep for the 8.4/8.5 runtime deprecations (curl_close,finfo_close,E_STRICT,$http_response_header, non-canonical casts, …) finds nothing else. In the locked runtime dependencies, Guzzle 7.15.2 only callscurl_close()/curl_share_close()behindPHP_VERSION_ID < 80000and useshttp_get_last_response_headers()when it exists.Validation: PHPUnit (155 tests, Imagick tests included) and PHPStan pass on PHP 8.2.35 and 8.5.12 with gd and imagick, and on 8.5.4 locally. On 8.5, no deprecations are left.