Skip to content

PHP 8.1 + Symfony 6.0 #675

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

Merged
merged 11 commits into from
Dec 21, 2021
Merged

PHP 8.1 + Symfony 6.0 #675

merged 11 commits into from
Dec 21, 2021

Conversation

ruudk
Copy link
Contributor

@ruudk ruudk commented Nov 30, 2021

@ruudk ruudk force-pushed the patch-7 branch 4 times, most recently from 384fe3d to 0c65ea5 Compare November 30, 2021 13:36
@ruudk ruudk marked this pull request as ready for review November 30, 2021 13:36
@ruudk ruudk requested a review from mihaileu as a code owner November 30, 2021 13:36
@ruudk
Copy link
Contributor Author

ruudk commented Nov 30, 2021

@mihaileu It's ready :) I had to drop the older PHP versions to be able to upgrade to the latest PHPUnit version. Since they are not supported anyway, I think this is good.

@javer
Copy link
Contributor

javer commented Dec 14, 2021

@ruudk Please resolve conflicts, and I hope this PR will be merged soon.

@ruudk
Copy link
Contributor Author

ruudk commented Dec 14, 2021

@javer done

@javer
Copy link
Contributor

javer commented Dec 14, 2021

@mihaileu Could you please review this PR?

@Eloar
Copy link
Contributor

Eloar commented Dec 17, 2021

What's the point exactly? Is there any problem with using this bundle with newer Symfony or PHP version without those changes? So far bundle works with older versions and doesn't force users to upgrade whole projects just because this Bundle updated.

Also it is very good practice to squash commits for PR.

@ruudk
Copy link
Contributor Author

ruudk commented Dec 17, 2021

What's the point exactly? Is there any problem with using this bundle with newer Symfony or PHP version without those changes? So far bundle works with older versions and doesn't force users to upgrade whole projects just because this Bundle updated.

I wouldn't have done this work if it wasn't needed obviously. There is no point in keeping this bundle in par with unsupported PHP versions. People on those versions should upgrade or keep the older releases of this bundle.

Also it is very good practice to squash commits for PR.

That's your opinion. That's not how I work.

@javer
Copy link
Contributor

javer commented Dec 17, 2021

@Eloar Of course it cannot be used with newer Symfony version, because it cannot even be installed at all:

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - php-amqplib/rabbitmq-bundle[2.10.0, ..., 2.10.2] require symfony/dependency-injection ^4.3|^5.0 -> found symfony/dependency-injection[v4.3.0, ..., v4.4.34, v5.0.0, ..., v5.4.1] but the package is fixed to v6.0.1 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
    - Root composer.json requires php-amqplib/rabbitmq-bundle 2.10.* -> satisfiable by php-amqplib/rabbitmq-bundle[2.10.0, 2.10.1, 2.10.2].

That's how composer constraints work:

"symfony/dependency-injection": "^4.3|^5.0",
"symfony/event-dispatcher": "^4.3|^5.0",
"symfony/config": "^4.3|^5.0",
"symfony/yaml": "^4.3|^5.0",
"symfony/console": "^4.3|^5.0",
"php-amqplib/php-amqplib": "^2.12.2|^3.0",
"psr/log": "^1.0 || ^2.0 || ^3.0",
"symfony/http-kernel": "^4.4|^5.0",
"symfony/framework-bundle": "^4.4|^5.0"

@javer
Copy link
Contributor

javer commented Dec 17, 2021

Can confirm that proposed changes works great in the real project with Symfony 6.0 and PHP 8.1.

@Eloar
Copy link
Contributor

Eloar commented Dec 17, 2021

So there is no point for dropping support, just extending it for new Symfony version. Old Symfony versions support is not a problem, the problem is lack of Symfony6 support.

I would recommend not changing lower versions constraints until it became problem for bundle. It is not up to a bundle to enforce people to upgrade projects.

@ruudk
Copy link
Contributor Author

ruudk commented Dec 17, 2021

@Eloar Feel free to create a PR and do it your way.

@Eloar
Copy link
Contributor

Eloar commented Dec 17, 2021

@ruudk to conflict changes in active Pull Request? That would be counterproductive. Decision is up to Bundle owner I just shared opinion. I like how liberal this bundle is.

@javer
Copy link
Contributor

javer commented Dec 17, 2021

PHPUnit 9.3+ is required to support PHP 8.0, and PHPUnit 9.5 is actually required to support PHP 8.1.
PHPUnit 9.5 requires php >=7.3, so we have to drop at least 7.1 and 7.2 which are beyond their EOL for at least one year.

@Eloar
Copy link
Contributor

Eloar commented Dec 17, 2021

@javer is there a point to drop PHPUnit ^7.5|^8.5 version constraint and not just extend it with ^9.5 for PHP 8.1?

@mihaileu
Copy link
Collaborator

mihaileu commented Dec 17, 2021

@ruudk @javer thx for this PR
I'll take a peek in this PR. For us it's important to keep the compatibility with the current allowed sy version in order to not create a BC and increase major. Otherwise we will need to maintain 2 versions of this library. I'll look into to see if we cover this situation

@ramunasd
Copy link
Member

Regarding PHPUnit compatibility, You can use same workaround as we did here php-amqplib/php-amqplib@393546c#diff-96a82592013e5f4b91e682332583b7a4a6ca1ff0431d267c61179b1a21b167daR6

@ruudk
Copy link
Contributor Author

ruudk commented Dec 21, 2021

Feel free to use my PR and improve it further. I'm not going to change it and support PHP versions that are EOL. Sorry. It took me already way too much time.

@javer javer mentioned this pull request Dec 21, 2021
"symfony/config": "^4.3|^5.0",
"symfony/yaml": "^4.3|^5.0",
"symfony/console": "^4.3|^5.0",
"symfony/dependency-injection": "^4.4|^5.3|^6.0",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why ^5.3, isn't it working with older versions of 5 ?

Copy link
Contributor Author

@ruudk ruudk Dec 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://symfony.com/releases , only 5.3 is supported, the rest is EOL

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ramunasd I see no reason to let old compatibility with php and symfony EOL. We will keep same major tag an increase the minor. There's kinda enough time passed in order to not affect too much people or at lease suggest them an update. What do you think ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK symfony 4.4 and 5.4 are LTS releases, we can stick to them

@@ -654,7 +654,7 @@ protected function injectConnection(Definition $definition, $connectionName)
$definition->addArgument(new Reference(sprintf('old_sound_rabbit_mq.connection.%s', $connectionName)));
}

public function getAlias()
public function getAlias() : string
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a space between ) and : ? if yes, we should eliminate that in order to stick as much as possbile with PSR12

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

php-cs-fixer should do this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add PSR12 style check for all PR's. These things should be noticeable automatically.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'll add php-cs-fixer as github action

@mihaileu mihaileu merged commit 638ea41 into php-amqplib:master Dec 21, 2021
@ruudk ruudk deleted the patch-7 branch December 21, 2021 12:58
@ruudk
Copy link
Contributor Author

ruudk commented Dec 21, 2021

Didn't expect this to be merged, thank you! @mihaileu 🎉

@mihaileu
Copy link
Collaborator

thanks for your contribution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants