You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here the unnamed first (0) parameter (string) is the name of the class.
The second unnamed (1) parameter (array, if present) is the constructor arguments.
Raise an error if unnamed parameters are present along with "__construct()" or "class".
Also, the '$' notation here may be redundant and looks like a developer error visually (lack of double quotes).
This improvement will simplify development and reduce the amount of code.
The text was updated successfully, but these errors were encountered:
In generally, idea with alternative syntax for class name and constructor arguments looks good. Seems, there should be no technical problems in implementation.
✔️ more shortly
❌ less clear
❌ two ways with same result
Also, the '$' notation here may be redundant and looks like a developer error visually (lack of double quotes).
Don't agree. $var looks as class property in code, it's clear and consistent with method calls (run()).
In my opinion, as this constructor and class are, they are excellent and explicit, having several ways to configure the same thing could cause problems in the future and confusion, the ideal is to have a single syntax.
I propose to add an alternative syntax for a simplified notation of the constructor and its arguments.
For example:
So it can be written like this:
Here the unnamed first (0) parameter (string) is the name of the class.
The second unnamed (1) parameter (array, if present) is the constructor arguments.
Raise an error if unnamed parameters are present along with "__construct()" or "class".
Also, the '$' notation here may be redundant and looks like a developer error visually (lack of double quotes).
This improvement will simplify development and reduce the amount of code.
The text was updated successfully, but these errors were encountered: