Skip to content

[Console] Add input argument getters with typehint #39110

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

noniagriconomie
Copy link
Contributor

Q A
Branch? 5.x
Bug fix? no
New feature? yes
Deprecations? no
Tickets Fix adding typehint
License MIT
Doc PR If PR accepted

Mimic https://github.com/symfony/symfony/blob/5.x/src/Symfony/Component/HttpFoundation/ParameterBag.php#L159

It can help write commands with proper args typehints like when dealing with request args via the parameterbag

I do not know if this was proposed before, thus feel free to close

Copy link
Member

@derrabus derrabus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see much value in this change. If you want to apply a type cast on the result of getArgument() you can already do so in userland. There's no need to hide that cast behind a method.

@noniagriconomie
Copy link
Contributor Author

@derrabus indeed, i was think that at first

but then i remembered the request param bag logic
and imho a console input arg is the same as a request query param for example

thx for stopping here :)

@chalasr chalasr added this to the 5.x milestone Nov 18, 2020
@derrabus
Copy link
Member

The parameter bag on the request does a little bit more than a type cast. Sorry, but I don‘t think we should implement these methods.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants