You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! I have a project with some commonly-used assertion functions that will throw if the given value converts to true (or false). Taking a cue from the examples on Narrowing Types > Custom type-checking functions and methods, I'd love to be able to do something like this:
This would allow, for example, narrowing a variable from SomeClass|null to SomeClass after this function was called. (Or, conversely, a function set up in the opposite way could narrow SomeClass|null to null.)
Did PHPStan help you today? Did it make you happy in any way?
PHPStan is amazing! 💖
The text was updated successfully, but these errors were encountered:
Feature request
Hi! I have a project with some commonly-used assertion functions that will throw if the given value converts to true (or false). Taking a cue from the examples on Narrowing Types > Custom type-checking functions and methods, I'd love to be able to do something like this:
This would allow, for example, narrowing a variable from
SomeClass|null
toSomeClass
after this function was called. (Or, conversely, a function set up in the opposite way could narrowSomeClass|null
tonull
.)Did PHPStan help you today? Did it make you happy in any way?
PHPStan is amazing! 💖
The text was updated successfully, but these errors were encountered: