-
-
Notifications
You must be signed in to change notification settings - Fork 206
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
Allow symfony 7 dependencies #395
Conversation
|
||
use function array_key_exists; | ||
use function array_values; | ||
use function get_class; | ||
use function sprintf; | ||
|
||
final class SymfonyFixturesLoader extends ContainerAwareLoader | ||
final class SymfonyFixturesLoader extends Loader |
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.
Is this a breaking change? How will it affect people still using Symfony 6? According to the deprecation message embedded in the bridge class, people should first "use dependency injection in [their] fixtures instead".
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.
Ah, just saw you edited the description :)
I'm not sure this is the point: people relying on container-aware fixtures get the very same deprecation as people not relying on it. It might have been better to wrap the injected container with a wrapper that triggers a deprecation whenever somebody calls I think there is a way to do this without a breaking change though:
if (class_exists(ContainerAwareLoader)) {
class IntermediaryContainer extends ContainerAwareLoader {}
} else {
class IntermediaryContainer extends Container {}
}
As a result, people with Symfony 6 will not be affected, and people with Symfony 7 cannot complain since they got a deprecation about this issue. The deprecation is used in an execution path that is unlikely to be overused, and I agree that developing something to turn it off might be overkill. |
Thanks for considering this with me :). If we do the conditional class: if (class_exists(ContainerAwareLoader)) {
class IntermediaryLoader extends ContainerAwareLoader {}
} else {
class IntermediaryLoader extends Loader {}
} Won't people using Symfony 6.4 get a deprecation warning that they can't silence? The |
Fully agree with you, but:
That being said, I just pushed 4.0.x, because in any case, there will need to be a contribution on that branch soon (either a cleanup, or we just retarget your PR). Ideally, it would be cool to have a way for users to opt-out, but I can't see how to embed such a condition inside |
I've just retargeted the branch to 4.0.x. It is, at least, a good starting point. For a new major, we can also drop old php & Symfony versions. Keep that separate from this PR or embed it? |
Let's go with separate PRs :) |
@greg0ire @weaverryan Great work with this. 😄 Are you gonna tag this soon or is there some other issue? Thank you! |
We don't plan to release 4.0 anytime soon. Use 3.5. |
@derrabus thanks for your answer. This is needed for Symfony 6.4, right? Or is there another way to proceed? |
There is. Use 3.5. |
Hi!
Allowing Symfony 7 dependencies to be installed.
This requires a BC break: to stop using the deprecated ContainerAwareLoader.
Do we want to TRY to have a BC-layer? It would require, I think, some config where the user "turns off" the
ContainerAwareLoader
to silence the deprecation. Honestly, I don't think anyone has used container-aware loaders for a long time - requiring an option sounds annoying for users. I'd vote for a new 4.0 with this change, but I'll defer to what others think is best.If we did a new major, we could also very easily drop old php & Symfony versions.
Cheers!