Skip to content

CommandListener relies on input arguments to have string keys #234

@sawmurai

Description

@sawmurai

The Listener/CommandListener depends on the keys of the array returned from $input->getArguments() to be strings. However depending on how $input is instantiated, it is possible that those keys are integers. This leads to an error because of strict type hinting.

Now, I think that under normal circumstances this does not happen. But, for example, if you are using https://github.com/liip/LiipFunctionalTestBundle in version 1.* and have an integration test that runs a command, the command name is added as argument without command_name: https://github.com/liip/LiipFunctionalTestBundle/blob/1.x/Test/WebTestCase.php#L146

I guess my questions is: Do you think ConsoleListener should be able to handle integer keys or not. If yes: I can provide a PR

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions