-
Notifications
You must be signed in to change notification settings - Fork 381
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
Support PHP 8 #1325
Support PHP 8 #1325
Conversation
In PHP8 vsprintf throws a ValueError when called with not enough arguments.
Older versions of imagine/imagine had incompatibilities with PHP 8, even though their composer.json stated it supported PHP 8.
"php": "^7.1", | ||
"imagine/imagine": "^1.1", | ||
"php": "^7.1|^8.0", | ||
"imagine/imagine": "^1.2.4", |
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.
As noted in the commit message:
Older versions of imagine/imagine had incompatibilities with PHP 8, even though their composer.json stated it supported PHP 8.
if (false !== $compiled = @vsprintf($format, $replacements)) { | ||
return $compiled; | ||
} | ||
} catch (ValueError $error) { |
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.
I decided to catch the error instead of changing the tests, to keep the contract consistent across PHP versions.
The tests are passing on CI. On my local machine I'm getting a number of I can see that I decided not to touch this in this PR because using |
this PR overlaps with #1313 also note the discussion here https://github.com/liip/LiipImagineBundle/pull/1313/files#diff-6ac3f79fc25d95cd1e3d51da53a4b21b939437392578a35ae8cd6d5366ca5485R39 /cc @fbourigault |
That's correct! I noticed that the build of #1313 was failing and I wanted to take a shot to fix it, as I needed LiipImagineBundle in a new PHP 8 project (I'm currently using my fork as a Composer dependency). It isn't my intention to steal @garak's thunder so feel free to close this PR in favor of #1313 and/or reuse my work there 🙂
Yes, I ran into the same issue working on this PR. I fixed it by raising the required imagine/imagine version to |
ok. sounds good. will wait for @fbourigault to give a nod befire merging |
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 good to me!
When will a new version be released? |
Ping @lsmith77 |
Alternative to #1313. This PR adds the 8.0 builds to GitHub Actions instead of Travis CI.
Feel free to close this PR in favor of #1313 and/or use my work in that PR.
Happy holidays! 🎄