Skip to content

Conversation

@kobelobster
Copy link

  • Transform traditional array syntax to short array syntax
  • Add PHP 7.1 return types
  • Make input argument of CommandTester::execute use an empty array per default
  • Make code PSR-2 conform

The reason for this PR is that I stumbled upon this documentation https://symfony.com/doc/current/console.html#testing-commands where the example shows

$commandTester->execute(array( 'command' => $command->getName(), // pass arguments to the helper 'username' => 'Wouter', // prefix the key with two dashes when passing options, // e.g: '--some-option' => 'option_value', ));

However, I saw, that the execute method already takes the name of the command passed in the constructor if no argument is passed, which means, for commands without input options you can just pass an empty array, therefore you could also make the default value of that argument an empty array.

I fixed PSR-2, return types and short array syntax as well, but don't know how Symfony handles that. I did that because composer.json requires php >=7.1 anyway, so all the features should be available, but can change it back if it's not within Symfony standards to do that.

* Add PHP 7.1 return types * Make input argument of CommandTester::execute use an empty array per default * Make code PSR-2 conform
@symfony-bot
Copy link

symfony-bot bot commented Mar 14, 2018

Thanks for your pull request! We love contributions.

However, this repository is what we call a "subtree split": a read-only copy of one directory of the main Symfony repository. It is used by Composer to allow developers to depend on specific Symfony components.

If you want to contribute, you should instead open a pull request on the main repository:

https://github.com/symfony/symfony

Thank you for your contribution!

PS: if you haven't already, please add tests, and beware that bug fixes should be submitted on the lowest maintained branch where they apply; only features should be submitted against the master branch.

@symfony-bot symfony-bot bot closed this Mar 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant