-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Drop support for PHP < 8.2 (aka version 4.0) #3881
Conversation
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.
There is some small upgrades that can be easily applied with rector: FirstClassCallableRector, ClassOnObjectRector, IsIterableRector, IsCountableRector, GetDebugTypeRector, ListToArrayDestructRector, ChangeSwitchToMatchRector, StrEndsWithRector, StrStartsWithRector
shouldn't you create a 4.x branch instead of targetting 3.x ? |
Is there any place that has all of the details about what changes are coming to 4.0? |
This PR was merged into the 3.x branch. Discussion ---------- Use PHP 8.0 functions with polyfill Backport some changes from #3881 into 3.x using `symfony/polyfill-php80`. - `str_starts_with` - `str_ends_with` - `str_contains` - `get_debug_type` Benefits: - Less conflicts when both 3.x and 4.x branches will be maintained. - Performance gain for PHP 8.0+ ([83,7% of installs](https://packagist.org/packages/twig/twig/php-stats#3)) Commits ------- 1d5c092 Use PHP 8.0 functions with polyfill
extra/html-extra/HtmlExtension.php
Outdated
@@ -71,7 +71,7 @@ public function dataUri(string $data, string $mime = null, array $parameters = [ | |||
$repr .= ';'.$key.'='.rawurlencode($value); | |||
} | |||
|
|||
if (0 === strpos($mime, 'text/')) { | |||
if (str_starts_with($mime, 'text/')) { |
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 missed this one in #3884. Not a big deal but you could consider merging everything in src
(in Symfony?)
$compiler->raw(', ')->subcompile($this->getNode('arguments')); | ||
} else { | ||
$compiler->raw(', []'); | ||
$compiler->raw(', arguments: ')->subcompile($this->getNode('arguments')); |
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.
Smart use of named arguments 👏. Does it solves any issue or is it only to improve the code?
e966d96
to
2c43d43
Compare
Closing. I've created the 4.x branch and merged some smaller PRs form this one. |
No description provided.