Middleware use case with callable/variadic types #4358
-
Consider I have a use-case with rate limiting middleware for any invokable service. Preconditions:
How can I handle this with phpstan? Example: https://phpstan.org/r/460c72aa-1dd7-42a5-ad80-0ab49fa1dffe Looking forward for any help, thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hi, this is how you get rid of the PHPDoc parse error https://phpstan.org/r/2e6a16d4-033d-433b-9b0a-33e384164c07 (see the docs https://phpstan.org/writing-php-code/phpdoc-types#callables), but variadics in generics aren't supported yet. |
Beta Was this translation helpful? Give feedback.
Hi, this is how you get rid of the PHPDoc parse error https://phpstan.org/r/2e6a16d4-033d-433b-9b0a-33e384164c07 (see the docs https://phpstan.org/writing-php-code/phpdoc-types#callables), but variadics in generics aren't supported yet.