-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Allowing files by any name to be imported via -c option. #3283
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
Allowing files by any name to be imported via -c option. #3283
Conversation
src/Config/ConfigLocator.php
Outdated
| 'drush.yml', | ||
| 'config/drush.yml', | ||
| ]; | ||
| $this->addConfigCandidates($processor, $loader, $dirs, $candidates); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be cleaner to combine addConfigCandidates functionality (sans adding) to separateFilesAndDirs method. Then, the later could just return a list of files, which could all be added together via addConfigFiles.
I could also support the current implementation if there's any problem/disagreement with the suggested refactor.
cc192a3 to
d19971a
Compare
| foreach ($paths as $path) { | ||
| if (file_exists($path)) { | ||
| if (is_dir($path)) { | ||
| $dirs[] = realpath($path); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you pass in $candidates to this function then you could call $this->identifyCandidates($dirs, $candidates); here (or at the end of this function). This would allow you to keep $dirs private to this method and return only $files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This improvement would of course imply a renaming of this method.
10beeb3 to
70dc2d7
Compare
46367ec to
70dc2d7
Compare
|
LTGM - thanks for doing the extra complexity-reducing refactors. |
No description provided.