yireo / Yireo_ExtensionChecker

Magento 2 module to check upon the code of Magento 2 modules from the CLI
91 stars 15 forks source link

Detect dependencies on console commands #33

Open norgeindian opened 2 years ago

norgeindian commented 2 years ago

I know, this surely not easy to implement, but it would be awesome, if usages of console commands could be detected. So for example, we have a module, which calls the regenerate:category:path from https://github.com/elgentos/magento2-regenerate-catalog-urls/blob/master/src/Console/Command/RegenerateCategoryPathCommand.php.

Nothing else from Elgentos_RegenerateCatalogUrls is used, only this console command. So we definitely have a dependency here, which is not detected. If there would be any way to solve that, it would be really appreciated.

sprankhub commented 2 years ago

The code pretty much looks like this:

$urlPathRegenerateCommand = $application->find('regenerate:category:path');
$input                    = new ArrayInput(['cids' => $categoryIds, '--store' => 'all']);
$output                   = new NullOutput();
$urlPathRegenerateCommand->run($input, $output);
jissereitsma commented 2 years ago

I've picked this up in version 2.2.2 which should now be able to detect CLI dependencies (scanning for find()).

sprankhub commented 1 year ago

Nice - I guess we can close this, then :)