Skip to content
This repository has been archived by the owner on Sep 23, 2022. It is now read-only.

Fixed an issue that does not work with symfony 3.4 #40

Merged
merged 1 commit into from
Jan 5, 2018

Conversation

chihiro-adachi
Copy link
Contributor

When running the test with symfony 3.4RC1, the following error occurred.

2) Tests\Provider\ConsoleServiceProviderTest::testLintTwigCommand
Symfony\Component\Console\Exception\LogicException: The command defined in "Knp\Command\Twig\DebugCommand" cannot have an empty name.

PHP Fatal error:  Uncaught Symfony\Component\Console\Exception\LogicException: The command defined in "Knp\Command\Twig\LintCommand" cannot have an empty name. in /Users/chihiro_adachi/repos/ConsoleServiceProvider/vendor/symfony/console/Application.php:432
Stack trace:
#0 /Users/chihiro_adachi/repos/ConsoleServiceProvider/Knp/Provider/ConsoleServiceProvider.php(49): Symfony\Component\Console\Application->add(Object(Knp\Command\Twig\LintCommand))
#1 /Users/chihiro_adachi/repos/ConsoleServiceProvider/vendor/pimple/pimple/src/Pimple/Container.php(118): Knp\Provider\ConsoleServiceProvider->Knp\Provider\{closure}(Object(Silex\Application))
#2 /Users/chihiro_adachi/repos/ConsoleServiceProvider/bin/console(28): Pimple\Container->offsetGet('console')
#3 {main}
  thrown in /Users/chihiro_adachi/repos/ConsoleServiceProvider/vendor/symfony/console/Application.php on line 432

It seems that the constructor of Symfony/Console/ Command has been changed, and the command name can not be acquired. I confirmed that it works by defining $defaultName.

@GregOriol
Copy link

The checks on Symfony's Command seem indeed much more restrictive now: the static defaultName must be defined on the called class, can't be on one of its parents as it was here. This PR should be accepted if Symfony's implementation is not going to change.

@SinSquare
Copy link

👍

@GregOriol
Copy link

Hey, it has been almost a month now and this issue is causing big problems with the latest symfony versions, maybe it's time to merge this request?

@skalpa skalpa merged commit 1d4cc12 into KnpLabs:master Jan 5, 2018
@skalpa
Copy link
Collaborator

skalpa commented Jan 5, 2018

Thank you @chihiro-adachi

@chihiro-adachi chihiro-adachi deleted the fix-symfony34-error branch January 9, 2018 01:14
@macintoshplus macintoshplus mentioned this pull request Jan 11, 2018
@GregOriol
Copy link

@skalpa Could you release this version so we can get it as stable when using symfony 3.4?

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

Successfully merging this pull request may close these issues.

None yet

4 participants