FriendsOfShopware/FroshDevelopmentHelper

Commands not visible under Shopware 6.4.3.0

Closed this issue · 3 comments

Question

Having installed version 0.3.2 under Shopware 6.4.3.0, I found that none of the CLI commands are working. They are simply not being detected. Installing the same version on Shopware 6.4.2.1 works just fine. So it seems there is something different, perhaps related to the introduction of Symfony 5.3?

Anyway, when trying to analyse the issue, it struck me that the service definitions in services.xml were also not declaring any of the commands as a service and therefore none of the classes are tagged as console.command. So that leads also to a complete lack of knowledge on my side (and few others that I've discussed this with): How can the CLI commands be picked up upon if a service definition is missing? Perhaps if someone who knows could briefly explain, then I can do the rest of the debugging.

shyim commented

Strange the plugin uses autoconfigure and autowire of Symfony https://symfony.com/doc/current/service_container/autowiring.html
It's for the real lazy guys. I will look later in it 🤔

After patching, there was no different in result. However, I then wiped out vendor/ and reinstalled all via composer, and automagically the problem disappeared. Problem was behind keyboard, I guess. Anyway, the issue was also to ask about how come the commands were configured automatically - I knew about autoconfiguration but thought it was only based on PHP annotations - I'll be diving in the docs deep for this. Thanks for the suggestions though! It definitely helped me understand Symfony again a bit better.