Project

General

Profile

Actions

Task #97559

open

Attributes: Use constructor parameter per property instead of an array

Added by Markus Pircher about 2 years ago. Updated 11 months ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Extbase
Start date:
2022-05-05
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
12
PHP Version:
8.0
Tags:
Complexity:
Sprint Focus:

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.


Files

Actions

Also available in: Atom PDF