-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DependencyInjection] Support psr/container v2 in contracts #41660
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
Conversation
This is a BC break. Let's target the 6.0 branch instead. |
I'm totally fine with targeting 6.0 instead, but I don't believe this should result in a BC break. Narrowing return types (in this case, going from implicit Having said that, it's not exactly causing a burning issue for me so I'm fine with waiting for the later version. |
But it's the opposite for project that use symfony. It's a BC break for all classes that implement the interface. Having a class without return type can implement the interface in 5.2 and being valid. But if you add a return type, the class will not be valid anymore |
Certainly. But this only permits the newer interface, not force it. Any project requiring I suppose if a project is using Symfony and using their own Container implementation without explicitly requiring Again, I won't belabor the point (and you'd certainly know Symfony usage characteristics better than I would), but for any project using this with correctly-declared dependencies, it should be completely safe and not a BC break. I'm under no pressure; just trying to get a line removed from |
But this changes our own signature due to allowing the new interface, which is a BC break for our own interface.
Projects would be totally fine in requiring the symfony package if what they implement is Symfony's ContainerInterface (which extends the PSR one). The PSR interface is used by the Symfony package, not by the project. But the new major version of psr/container impacts the public API of the Symfony interface. |
This should also update other packages requiring |
I'm closing because we're not ready yet. There are many more changes we need to do before doing this change (eg prepare a deprecation layer, bump the major version of contracts, etc.) |
Is there a timeline on when this dependency can be upgraded? |
End of November. |
This adds support for
psr/container
2.x incontracts
(and more specificallyservice-contracts
. After digging through dependencies, I found this (which is required viaconsole
) as the last remaining place in my code that required the 1.x line.