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 TIL thanks!