Replies: 1 comment
-
|
It seems that this can be done in the following way: https://phpstan.org/r/1602e3ff-a46e-42b3-ad4e-0884a0856056 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm using a
Collectionin an enum and trying to make phpstan understand that the enum is not empty.I've tried it by defining that the array that goes into the Collection is non-empty via
@method static non-empty-list<MyEnum> cases(), but that doesn't seem to work: https://phpstan.org/r/6892c3ee-247f-4b29-8af8-63431952af96I've also tried with an extending "NonEmptyCollection" without result: https://phpstan.org/r/520b5d54-b0f4-4cc6-badb-3515c9e9ec7e
This is not an issue when the Collection is defined as non-empty: https://phpstan.org/r/683d781f-0710-4a91-9959-d1b7d413265b, but that class comes with the framework.
Is there a way to make this happen? What tags am I missing?
Beta Was this translation helpful? Give feedback.
All reactions