Did you know you can typehint array keys? @phpStorm will recognise the docblock and provide autocompletion.

Example taken from https://writing-readable-php.com/
#php

Writing Readable PHP - A collection of tricks and trip to improve the readability of your code.

Learn how to write code that’s a joy to read for you, your co-workers, and future self. View high-quality videos on both clean coding and static analysis.

Writing Readable PHP

@freekmurze remember `array{foo: bar, baz: tab, ...}` when you accept arrays with more keys (the 3 `...` are important).

https://psalm.dev/articles/psalm-5

Announcing Psalm 5

@ocramius Thanks for the heads up - I can see the logic behind that change but that's going to mess up a lot of our usage where we only typehint what fields a method needs. Guess it'll just be a case of one run, then add `...` to any failing cases
@freekmurze Static analysis tools like PHPStan and Pslam also support array shapes, which is extremely helpful