Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new dev:module:detect-composer-dependencies command (netz98 contribution) #954

Merged
merged 4 commits into from
Mar 12, 2022

Conversation

cmuench
Copy link
Member

@cmuench cmuench commented Mar 12, 2022

Magerun pull-request check-list:

  • Pull request against develop branch (if not, just close and create a new one against it)
  • README.md reflects changes (if any)
  • phar fuctional test (in tests/phar-test.sh)

Summary: Backport of a command used in a netz98 QA suite to migrate modules.

This command scans the code for Composer dependencies and provide a recommendation. It can print only missing dependencies.

Special thanks go to:

Changes proposed in this pull request:

  • Provide new command dev:module:detect-composer-dependencies

@cmuench cmuench merged commit ca0f2fb into netz98:develop Mar 12, 2022
@cmuench cmuench deleted the feature/detect-dependencies branch March 12, 2022 10:06
protected function configure(): void
{
$this->setName('dev:module:detect-composer-dependencies')
->addArgument('path', InputArgument::IS_ARRAY, 'Path to modules')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @cmuench

This is a great new feature, I've just tried it, out of curiosity, but the first time I executed it I got an error that wasn't very helpful:

$ n98-magerun2.phar dev:module:detect-composer-dependencies

In Finder.php line 614:

  You must call one of in() or append() methods before iterating over a Finder.

This was because I didn't check how to execute the command at first, and because the path argument was missing.
It's probably a good idea to mark this argument as required using InputArgument::IS_ARRAY | InputArgument::REQUIRED, no?

Thanks! 🙂

Copy link
Member Author

@cmuench cmuench Mar 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hostep Yes, good finding. I will change that.

cmuench added a commit to cmuench/n98-magerun2 that referenced this pull request Mar 15, 2022
cmuench added a commit that referenced this pull request Mar 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants