Issue Task Closed

#97559Attributes: Use constructor parameter per property instead of an array

Markus Pircher 05/05/22, 10:55 updated 12/02/25, 14:33

Description

I saw that with v12 attribute support.
Unfortunately, i find it counterproductive that arrays are used for the parameters here. This breaks type safety, breaks code completion, and can easily lead to overlooked typos.
constructor parameters for each parameter would also make it easier to show the programmers which parameters are required.
PHP 8 offers named parameters, so the argument that you don’t have to fill in all parameters with the array, wouldn’t count.

Reviews 2