Skip to content

How to resolve a type of an inheritetd property #11034

Answered by ondrejmirtes
iVovolk asked this question in Support
Discussion options

You must be logged in to vote

You can use this extension to basically override anything: https://apiref.phpstan.org/1.11.x/PHPStan.Type.ExpressionTypeResolverExtension.html

If you want to override the type of property, write some logic if PropertyFetch is given as the $expr parameter. Otherwise return null.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@iVovolk
Comment options

@ondrejmirtes
Comment options

@iVovolk
Comment options

Answer selected by iVovolk
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