-
Notifications
You must be signed in to change notification settings - Fork 55
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
Add getSession stub #242
Add getSession stub #242
Conversation
012f89d
to
317a234
Compare
@@ -92,6 +97,8 @@ jobs: | |||
symfony-version: 6 | |||
- php-version: 8.0 | |||
symfony-version: 3 | |||
- php-version: 8.0 | |||
symfony-version: 6 |
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.
@VincentLanglet Why exclude Symfony6 with PHP8?
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.
It's currently a big failure because codeception doesn't support symfony 6.
https://github.com/Codeception/Codeception/blob/4.1/composer.json#L24
I can add back if you prefer, it will just mean the ci will always fail.
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.
no problem, once codeception dependency is fixed, we can remove the ignore
Thanks, looks good 👍 |
Hi @seferov
There was the following discussion on phpstan-symfony phpstan/phpstan-symfony#233.
For 99% of the symfony users,
$request->getSession()
is returning a Session with thegetFlashbag
method which is not in SessionInterface. In the commit phpstan/phpstan-symfony@012305d, phpstan update the stub to make people life easier and avoiding the extract checkinstanceof Session
.I recommend psalm plugin to do the same because using both plugin gives the following issue.
-> without the check
assert($session instanceof Session)
, psalm say thegetFlashbag
method doesn't exists-> with the check, phpstan say the
assert($session instanceof Session)
check is always true.