Replies: 1 comment 1 reply
-
Something similar has been discussed in #4826 , but note that it will only be accessible to plugins. I.e. you won't be able to use it in docblocks and all internal Psalm checks will consider those custom subtypes as their parent type that are known to Psalm, as plugins currently have no way to extend parser and type comparison. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This might be a stretch, maybe better for a plugin, but it can be common when working with databases to carry around dates as a string representation. In this case it can be useful to know that if I try to create a DateTime object, said object will be valid. I can type this on a return from, e.g. PDO_FETCH_ASSOC where I know that a field is both present and must be a date, or where some previous validation of user input has assured me it is a date.
Has anybody seen something like this before?
Beta Was this translation helpful? Give feedback.
All reactions