Replies: 1 comment 2 replies
-
|
This is how the PHPDoc type is defined in TypeNodeResolver: case 'callable-array':
return new IntersectionType([new ArrayType(new MixedType(), new MixedType()), new CallableType()]);To make this error go away, what would make sense to me that callable array can only be case 'callable-array':
return new IntersectionType([new ArrayType(new StringType(), new StringType()), new CallableType()]); |
Beta Was this translation helpful? Give feedback.
2 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.
-
I tried using the
callable-arrayPHPDoc type, e.g.:But I get the following error:
I then tried adding more specific types:
However, I now get this error:
Playground link:
https://phpstan.org/r/3a564dea-a6dd-4680-8089-c0c8d81e05ab
What is the correct way to use this type?
Beta Was this translation helpful? Give feedback.
All reactions