Skip to content

Update access_denied_handler.rst #18584

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

Closed
wants to merge 4 commits into from
Closed

Conversation

talha-core
Copy link

@talha-core talha-core commented Jul 20, 2023

getFlashBag() funciton is not there anymore

@talha-core talha-core marked this pull request as ready for review July 20, 2023 07:51
@xabbuh
Copy link
Member

xabbuh commented Jul 20, 2023

@talha-core
Copy link
Author

The method is still defined here: https://github.com/symfony/symfony/blob/6.3/src/Symfony/Component/HttpFoundation/Session/Session.php#L230

I see, but phpstan throws error

@wouterj
Copy link
Member

wouterj commented Feb 19, 2024

This is expected to error. If you want to be strict, you have to check if getSession() returns an instance of FlashBagAwareSessionInterface before calling the method. See phpstan/phpstan-symfony#324 (and referenced Symfony issues) for more details.

For the docs, I think we prefer this compact version as this will work for 99% of the Symfony applications and doesn't distract the code example from what we're actually wanting to showcase.

@wouterj wouterj closed this Feb 19, 2024
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.

4 participants