Skip to content

[Contracts] add return types and bump to v3 #42088

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 1 commit into from
Jul 15, 2021

Conversation

nicolas-grekas
Copy link
Member

Q A
Branch? 6.0
Bug fix? no
New feature? yes
Deprecations? no
Tickets #42058
License MIT
Doc PR -

@nicolas-grekas
Copy link
Member Author

PR ready!

@nicolas-grekas nicolas-grekas force-pushed the contracts3 branch 2 times, most recently from dddcc52 to cb120f4 Compare July 13, 2021 14:52
@nicolas-grekas
Copy link
Member Author

this should require psr/container 2.0

I agree, and I did the same for psr/cache, sticking to 3.0.
Now blocked by doctrine/cache#382
/cc @derrabus

Copy link
Contributor

@Tobion Tobion left a comment

Choose a reason for hiding this comment

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

LGTM but don't the test failures indicate a problem?

PHP Fatal error: Declaration of Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\FormLoginBundle\Controller\LoginController::getSubscribedServices() must be compatible with Symfony\Contracts\Service\ServiceSubscriberInterface::getSubscribedServices(): array in /home/runner/work/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/Controller/LoginController.php on line 66

@derrabus
Copy link
Member

Thank you Nicolas.

@derrabus derrabus merged commit b28f7e7 into symfony:6.0 Jul 15, 2021
@nicolas-grekas nicolas-grekas deleted the contracts3 branch July 15, 2021 07:23
@fabpot fabpot mentioned this pull request Nov 5, 2021
derrabus added a commit that referenced this pull request Dec 20, 2023
This PR was merged into the 6.4 branch.

Discussion
----------

[Contracts] Allow psr/container 1.1 again

| Q             | A
| ------------- | ---
| Branch?       | 6.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Issues        | N/A
| License       | MIT

The only difference between psr/container 1.1 and 2.0 is one additional return type on the `ContainerInterface::has()` method, see php-fig/container@1.1.2...2.0.2

This means that if a package is compatible with 2.0 already (== all implementations already have that return type), it remains compatible with 1.1. However, in #42088 we changed the composer.json of our service-contracts package and replaced `^1.1` with `^2.0`, dropping support for 1.1 although there was no need to do so.

I'm migrating a larger application to Symfony 7 at the moment which also consumes various Laminas packages. Due to Laminas still being stuck on psr/container 1.1, I cannot upgrade to service-contracts 3 which in turn blocks my Symfony 7 upgrade.

It would smoothen the upgrade path a lot for me, if we released a service-contracts 3.x that allows the installation of psr/container 1.1 again.

Commits
-------

80d34d0 Allow psr/container 1.1 again
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants