-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[Symfony 6] Fix zone member integrity listener #14065
[Symfony 6] Fix zone member integrity listener #14065
Conversation
loic425
commented
Jun 7, 2022
•
edited
Loading
edited
Q | A |
---|---|
Branch? | 1.11 |
Bug fix? | yes (for Symfony 6) |
New feature? | no |
BC breaks? | not yet |
Deprecations? | no |
Related tickets | partially #13274 related #14041 |
License | MIT |
src/Sylius/Bundle/AddressingBundle/spec/EventListener/ZoneMemberIntegrityListenerSpec.php
Outdated
Show resolved
Hide resolved
src/Sylius/Bundle/AddressingBundle/spec/EventListener/ZoneMemberIntegrityListenerSpec.php
Outdated
Show resolved
Hide resolved
src/Sylius/Bundle/AddressingBundle/spec/EventListener/ZoneMemberIntegrityListenerSpec.php
Outdated
Show resolved
Hide resolved
Co-authored-by: Grzegorz Sadowski <sadowskigp@gmail.com>
use Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface; | ||
use Symfony\Component\HttpFoundation\Session\SessionInterface; | ||
use Webmozart\Assert\Assert; | ||
|
||
final class ZoneMemberIntegrityListener | ||
{ | ||
public function __construct( | ||
private SessionInterface $session, | ||
private SessionInterface|RequestStack $sessionOrRequestStack, |
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.
Why don't we just use RequestStack
here? It already has getSession()
method in Symfony 5, so we will not have a problem with removing it later 😄
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.
I'm not sure about what you mean. If you talk about the argument type SessionInterface|RequestStack, we cannot getting session from RequestStack on Symfony 4.4.
If you talk about the argument name "$requestStack", I agree, we can use this name to make it simpler while dropping Symfony 4 support (next release).
Thanks, Loïc! 🎉 |