Skip to content

Conditional return: access to class members #10543

Answered by ondrejmirtes
mbolli asked this question in Support
Discussion options

You must be logged in to vote

You need to ask about T, not about property: https://phpstan.org/r/4990f201-cc03-4322-9ddf-2f2e2a270c13

You should also verify with \PHPStan\dumpType() if the type behaves as expected.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by mbolli
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Support
Labels
None yet
2 participants