3 ms·
> until you get arrays which can take anything There's a widely-used PHPDoc standard for annotating arrays: `Foo[]`, and there are at least three PHP static an
by muglug 7y ago
> until you get arrays which can take anything
There's a widely-used PHPDoc standard for annotating arrays: `Foo[]`, and there are at least three PHP static analysis tools that can correctly interpret those annotations: Psalm (https://psalm.dev https://psalm.dev), Phan (https://github.com/phan/phan https://github.com/phan/phan) and PHPStan (https://github.com/phpstan/phpstan https://github.com/phpstan/phpstan).
Phan and Psalm also support a docblock syntax for generics - I wrote about it here: https://medium.com/vimeo-engineering-blog/uncovering-php-bugs-with-template-a4ca46eb9aeb https://medium.com/vimeo-engineering-blog/uncovering-php-bug...
- 72deluxe 7y agoThanks for this! This is just what I was looking to know Thanks!