Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[console][ArrayInput] avoid return array value for getFirstArgument. #14197

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

Closed
wants to merge 1 commit into from

Conversation

aitboudad
Copy link
Contributor

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Fixed tickets #14116
Tests pass? yes
License MIT

@mpdude
Copy link
Contributor

mpdude commented Apr 3, 2015

Can someone explain me why this is the right fix?

I mean, why shouldn't it return an array if the first argument is an array?

@xabbuh
Copy link
Member

xabbuh commented Apr 3, 2015

@aitboudad Afaics, the first argument is not necessarily the command being executed. For example, the CommandTester just appends it to the existing input parameters when no command key is given.

@xabbuh
Copy link
Member

xabbuh commented Apr 3, 2015

So, if the filename argument were not defined as an array (or if another non-array argument were added in the future), getFirstArgument() would return that argument and not the command name.

@aitboudad
Copy link
Contributor Author

@xabbuh yes I know :) in this PR I'm not attempts to return the command name as first argument but just to make ArrayInput compatible with InputInterface.

@fabpot
Copy link
Member

fabpot commented Apr 4, 2015

I agree with @mpdude, I don't think this is the right fix.

@fabpot
Copy link
Member

fabpot commented Apr 4, 2015

What about #14205?

@mpdude
Copy link
Contributor

mpdude commented Apr 4, 2015

Updated #14205.

@aitboudad
Copy link
Contributor Author

what do you think to change getFirstArgument return type to mixed ?

    /**
     * @return mixed
     */
    public function getFirstArgument();

@mpdude
Copy link
Contributor

mpdude commented Apr 4, 2015

Is the first argument guaranteed to be the command name and thus a string?

If yes, where can I see that?

@fabpot
Copy link
Member

fabpot commented Apr 4, 2015

closing in favor of #14205

@fabpot fabpot closed this Apr 4, 2015
@aitboudad aitboudad deleted the console_array_input branch April 4, 2015 11:55
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