Constant type as return type of methods returning constant expression #4409
-
I have another question which would really hellp us with our custom extension. Is it possible to detect return type of method that returns constant as constant? It seems that PHPStan did not check that. See https://phpstan.org/r/33e16989-32ca-49fc-a3a2-dd55cc9a1231 there is no warning for always true comparsion if return or constant method is compared. But it would really help us if we would be able to somehow determine thet method returns constant value and which value because we would need it to implement custom extension (class have method that returns type of entity and we would like to resolve dynaimc return type of many methods to this entity instead of generic ancestor). But if I use simply: Is it possible to do it or do I want too much? :-) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
I don't get it - you can express it in PHPDocs... https://phpstan.org/r/3a03bf97-4da7-4b93-ab03-1c10310abe7d |
Beta Was this translation helpful? Give feedback.
I don't get it - you can express it in PHPDocs... https://phpstan.org/r/3a03bf97-4da7-4b93-ab03-1c10310abe7d