This clears up a common source of type check errors when using php intelephense.
Details
Diff Detail
- Repository
- rP Phorge
- Branch
- query_templates (branched from master)
- Lint
Lint Passed - Unit
Tests Passed - Build Status
Buildable 2028 Build 2028: arc lint + arc unit
Event Timeline
Nice find. Applying this patch removes about 250 errors in phpstan output here.
As neither dict nor dictionary (sigh) are listed as a complex type in https://we.phorge.it/source/arcanist/browse/master/src/parser/PhutilTypeSpec.php I cannot imagine side effects (well it's "only" PHPDocs anyway).
(We should probably kill all those dict and dictionary PHPDoc items and for the start mass-replace them with array?)
Yeah, I've been wanting to put up a codemod diffs that get rid of all the custom types: wild, dict, dictionary, map, etc. None of these are understood by modern phpdoc tooling and while we could configure phpstan to understand them, it's probably easiest to just use whatever everyone else is using, especially because some editor extensions don't have a way to add custom types so we'd be leaving potential contributors at a disadvantage if they don't have phpstan.
Thanks for the accept!