Skip to content

Fix hasSession specifier #181

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

Merged
merged 1 commit into from
Jul 1, 2021
Merged

Conversation

VincentLanglet
Copy link
Contributor

Closes #86

I didn't succeed to reproduce the test proposed here #86 (comment)

But the code I added were failing prior to this change.

@ondrejmirtes
Copy link
Member

Please add your efforts reproducing this case, thanks.

@VincentLanglet
Copy link
Contributor Author

Please add your efforts reproducing this case, thanks.

I had basically nothing.

My issue is that https://github.com/phpstan/phpstan-beberlei-assert/blob/master/tests/Type/BeberleiAssert/ImpossibleCheckTypeMethodCallRuleTest.php is a RuleTestCase but here, I'm testing a TypeSpecifier, so I don't have any rule to provide (and instead dunno how to provide the type specifier).

@ondrejmirtes
Copy link
Member

It works exactly the same way, you just need to provide a file that shows the code that fails (but shouldn't fail).

@VincentLanglet
Copy link
Contributor Author

It works exactly the same way, you just need to provide a file that shows the code that fails (but shouldn't fail).

But what do I pass to

protected function getRule(): Rule

?

@ondrejmirtes
Copy link
Member

The same thing I linked, you just copy that part.

@VincentLanglet
Copy link
Contributor Author

The same thing I linked, you just copy that part.

Oh my bad, I've updated the tests now.
I check that request_get_session.php has no phpstan error. Without the fix I tried, and I had the "always true" error.

@ondrejmirtes ondrejmirtes merged commit 61f1d20 into phpstan:master Jul 1, 2021
@ondrejmirtes
Copy link
Member

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Call to method Request::hasSession() will always evaluate to true.
2 participants