Closed dmolineus closed 2 years ago
Just out of interest:
list<x>
means [a_of_x, b_of_x, …]
which, in PHP, is non-distinguishable from [0 => a_of_x, 1 => b_of_x. …]
, i.e. a associative array with zero based numeric keys with no gaps. So is using list<x>
over array<x>
or array<int, x>
purely there for semantics or does it guarantee that keys are indeed canonical?
does it guarantee that keys are indeed canonical?
Yep, that's the definition (according to psalm), array_values
returns a list of elements.
See also https://psalm.dev/docs/annotating_code/type_syntax/array_types/
Is there anything missing or should be improved here?
ping @dmolineus
::class
on objects is only supported as of PHP 8.0, however, the plugin supports PHP 7.1+ as well. We have to keep the\get_class()
calls therefore.
I adjusted the coding standard and removed the ::class
usages
Thank you @dmolineus.
This pull request improves some type documentations. When working with static analysis tools like psalm in a strict level Contao type docs are a bit cumbersome on many places.