Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[TwigBridge] Change return type of Symfony\Bridge\Twig\AppVariable::getSession()#50794
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
carsonbot commentedJun 27, 2023
Hey! I see that this is your first PR. That is great! Welcome! Symfony has acontribution guide which I suggest you to read. In short:
Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change. When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor! I am going to sit back now and wait for the reviews. Cheers! Carsonbot |
carsonbot commentedJun 27, 2023
It looks like you unchecked the "Allow edits from maintainer" box. That is fine, but please note that if you have multiple commits, you'll need to squash your commits into one before this can be merged. Or, you can check the "Allow edits from maintainers" box and the maintainer can squash for you. Cheers! Carsonbot |
Change the return type of AppVariable.php getSession from 'Session' to 'SessionInterface', to be in line with the return type of getSession in http-foundation/Request.php
Change the return type of AppVariable.php getSession from 'Session' to 'FlashBagAwareSessionInterface'
derrabus commentedJun 27, 2023
The failing tests on the low-deps run look related. |
Nyholm commentedJun 27, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Thank you for this PR. I see you replaced the return type from class I suggest to change it to |
GromNaN left a comment• edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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.
TheFlashBagAwareSessionInterface was introduced insymfony/http-foundation: 6.2 by#46491, andsymfony/twig-bridge: 6.2 allowssymfony/http-foundation: 5.4 in which the interface doesn't exit.
We usually don't update the dependencies constraints in maintenance branches except for security reasons. I don't think we should accept this change as a bugfix, it looks more like a new feature that would target the next version (6.4 ATM).
Also,Symfony\Component\HttpFoundation\Session\Session implements\IteratorAggregate and\Countable on top ofFlashBagAwareSessionInterface orSessionInterface. Changing the return type to this single interface would reduce the functions that could be used in the templates.
Uh oh!
There was an error while loading.Please reload this page.
Nyholm commentedJun 27, 2023
I was hesitating if this was a bugfix or not. But with@GromNaN arguments, I agree. This is a feature. |
derrabus commentedJun 28, 2023
I think, if we change the return type to |
Change the return type of AppVariable.php getSession from 'Session' to 'SessionInterface'
Dirkhuethorst commentedJul 17, 2023
I've changed the return type to SessionInterface, but now the Psalm check fails because in the AppVariable class the Flashbag of the session is accessed.
I am not sure how to proceed with this issue |
GromNaN commentedJul 17, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
You can |
Dirkhuethorst commentedJul 17, 2023
Won't that break backwards compatibility with http-foundation 5.4 where the FlashBagAwareSessionInterface does not exist? |
Change the return type of AppVariable.php getSession from 'Session' to 'SessionInterface'
Uh oh!
There was an error while loading.Please reload this page.
Change the return type of AppVariable.php getSession from 'Session' to 'SessionInterface'
fabpot commentedSep 10, 2023
Thank you@Dirkhuethorst. |
…Variable::getSession() (Dirkhuethorst)This PR was submitted for the 6.2 branch but it was squashed and merged into the 6.3 branch instead.Discussion----------[TwigBridge] Change return type of Symfony\Bridge\Twig\AppVariable::getSession()Change the return type of AppVariable.php getSession from 'Session' to 'SessionInterface', to be in line with the return type of getSession in http-foundation/Request.php| Q | A| ------------- | ---| Branch? | 6.2| Bug fix? | no| New feature? | yes| Deprecations? | no| Tickets |Fix#50789| License | MIT| Doc PR |Commits-------9dafdc1 [TwigBridge] Change return type of Symfony\Bridge\Twig\AppVariable::getSession()
fabpot commentedSep 10, 2023
Merged, but Github didn't get the memo. |
…ashes()` (derrabus)This PR was merged into the 7.0 branch.Discussion----------[TwigBridge] Remove duck typing from `AppVariable::getFlashes()`| Q | A| ------------- | ---| Branch? | 7.0| Bug fix? | no| New feature? | no| Deprecations? | no| Tickets | Follows#50794| License | MIT| Doc PR | N/ACommits-------3bd4e60 [TwigBridge] Remove duck typing from AppVariable::getFlashes()
Uh oh!
There was an error while loading.Please reload this page.
Change the return type of AppVariable.php getSession from 'Session' to 'SessionInterface', to be in line with the return type of getSession in http-foundation/Request.php