stecman / symfony-console-completion

Automatic tab-key completion for Symfony console application options, arguments and parameters
MIT License
420 stars 26 forks source link

Do not complete hidden commands #75

Closed Programie closed 7 years ago

Programie commented 7 years ago

Fix #74

aik099 commented 7 years ago

The Travis CI builds are failing. Now I understand why _completion command wasn't marked as hidden initially. The hidden command functionality was added in Symfony Console 3.2 only and this library works with Symfony Console 2.x or 3.x.

So I guess you need to create polyfill for hidden commands for Symfony 2.x or do some clever tricks, like:

.

stecman commented 7 years ago

Thanks @Programie and @aik099. Looks good once @aik099's changes are made 👍

Programie commented 7 years ago

I will try to implement support for Symfony 2.x. All other suggestions are now implemented.

Programie commented 7 years ago

Currently the builds are still failing, as I'm using setHidden() in the HiddenCommand test class.

How would you test a hidden command if command hiding is not supported in Symfony 2.x?

Simply not adding the command if setHidden() method does not exist might be not the best way. How about overwriting setHidden and isHidden in the HiddenCommand class?

aik099 commented 7 years ago

How about overwriting setHidden and isHidden in the HiddenCommand class?

That would rely on fact, that methods are not final currently and stay not final in future.

Instead I recommend adding HiddenCommand in test suite configuration only when such setHidden method exists in base command class. That would make sure code is executed when Travis uses Symfony 3 (PHP 5.6 and PHP 7.x if I'm not mistaken).

aik099 commented 7 years ago

Once all tests pass (on Travis CI) consider PR approved from my side.

Programie commented 7 years ago

The normal PHP test builds are now passing, but the HHVM build is failing because of some Debian package conflicts.

stecman commented 7 years ago

Thanks @Programie 👍