Skip to content
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

Closed
wants to merge 1 commit into from
Closed

Conversation

fabpot
Copy link
Contributor

@fabpot fabpot commented Oct 7, 2023

No description provided.

@fabpot fabpot changed the title Drop support for PHP < 8.2 Drop support for PHP < 8.2 (aka version 4.0) Oct 7, 2023
Copy link
Contributor

@GromNaN GromNaN left a 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

src/Node/Expression/CallExpression.php Outdated Show resolved Hide resolved
CHANGELOG Outdated Show resolved Hide resolved
@stof
Copy link
Member

stof commented Oct 10, 2023

shouldn't you create a 4.x branch instead of targetting 3.x ?

@joeworkman
Copy link

Is there any place that has all of the details about what changes are coming to 4.0?

fabpot added a commit that referenced this pull request Oct 20, 2023
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
@@ -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/')) {
Copy link
Contributor

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'));
Copy link
Contributor

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?

tests/Node/Expression/NameTest.php Show resolved Hide resolved
@fabpot
Copy link
Contributor Author

fabpot commented Dec 9, 2023

Closing. I've created the 4.x branch and merged some smaller PRs form this one.

@fabpot fabpot closed this Dec 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants