-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[Console] Rename #[Input] to #[MapInput]
#61890
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
yceruto
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree primarily for consistency with other controller attributes, and I also agree that its main purpose is mapping raw input values into an object (DTO), so MapInput makes sense to me.
The problem now is that #[Argument] and #[Option] are in a similar situation, aren't they? and it'll feel inconsistent that two closely related concepts follow different naming conventions in the same context. For instance:
function __invoke(#[MapInput] TestDto $dto, #[Option] bool $test = false)Both naming conventions are valid to me:
MapInputfocuses on the action/operation around the parameter value,Input(same asArgument&Option) broadly reflects the parameter's role.
Even if the reasons explained are completely valid to me, I think consistency should be tied to the component itself first, then to other components and the framework if possible. That's why I choose Input for this attribute.
|
Another valid alternative could be moving all these attributes under a namespace that provides context, e.g. |
|
To me, attributes prefixed with That's why |
|
@yceruto I understand your POV but share Mathias' opinion. The concept of |
yceruto
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with your POV as well, I just wanted to share the other side for consideration.
239a5a0 to
fce9d5f
Compare
|
Thank you @chalasr. |
Reasoning:
InputwithInputInterfaceimplementationsMapconvention from controllers is nice, sticking with it makes sense and brings consistency#[MapEntity]on its wayFabbot's fail is a false positive.