Page MenuHomePhorge

LiskDAO::getConfiguration return typing
AcceptedPublic

Authored by amybones on Fri, May 30, 23:11.

Details

Reviewers
aklapper
Group Reviewers
O1: Blessed Committers
Summary

This clears up a common source of type check errors when using php intelephense.

Test Plan

See the squiggles in vscode go away :)

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

aklapper subscribed.

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?)

This revision is now accepted and ready to land.Sat, May 31, 13:33

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!