-
Notifications
You must be signed in to change notification settings - Fork 529
Fix PHP 8.4 deprecations nullable objects #865
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix PHP 8.4 deprecations nullable objects #865
Conversation
|
Nullable types are only supported since PHP 7.1.0 so we would need to increase the version constraint in Line 20 in 8908a6c
|
|
@mlocati should we increase min version? |
|
I think so. PHP 5 is very very outdated (but I'd keep compatibility with PHP 7) |
|
@mlocati adopted. Think the rest of the errors are unrelated and in some cases connected to: php-imagine/docker-builder#5 |
I've just published all the docker images required for tests |
4a5ef21 to
3704e6b
Compare
| public function testWebpFormatIsAllowedAsAnimatedFormat() | ||
| { | ||
| $palette = new RGB(); | ||
| $this->checkGmagickMockable(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks this was missed in another PR to be checked. Added to fix some CI issue.
|
Can somebody help me with:
|
I think the simplest solution is to avoid mocks. Something like this: public function testWebpFormatIsAllowedAsAnimatedFormat()
{
$image = $this->getImagine()->open(IMAGINE_TEST_FIXTURESFOLDER . '/anima3.gif');
$originalDelayInTicks = $image->layers()->get(0)->getImagick()->getImageDelay();
$image->layers()->animate('webp', (int) (1000 + $originalDelayInTicks * 1000 / 20), 0);
$this->assertSame('webp', $image->getImagick()->getFormat());
$newDelayInTicks = $image->layers()->get(0)->getImagick()->getImageDelay();
$this->assertNotEquals($originalDelayInTicks, $newDelayInTicks);
} |
|
My guess would be that Imagine/src/Imagick/Layers.php Line 180 in 8908a6c
Maybe adding the following lines to the test might solve it: $resource->expects($this->atLeastOnce())
->method('getImage')
->will($this->returnValue($resource)); |
|
Thank you both. I did go with the mockless solution looks the CI is now green 🎉 |
|
Thank you! |
This should avoid outpus like: