-
-
Notifications
You must be signed in to change notification settings - Fork 47
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
Support for "Globstar" pattern #83
Support for "Globstar" pattern #83
Conversation
Added support for globstar when resolving paths in the FileIterator factory. The extended glob function was adapted from funkjedi's implementation: https://gist.github.com/funkjedi/3feee27d873ae2297b8e2370a7082aad Fixed facade test to include newly created fixture directories.
Removed unnecessary formatting changes.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #83 +/- ##
===========================================
Coverage 100.00% 100.00%
- Complexity 38 44 +6
===========================================
Files 4 4
Lines 95 114 +19
===========================================
+ Hits 95 114 +19 ☔ View full report in Codecov by Sentry. |
@funkjedi This PR copies your code from https://gist.github.com/funkjedi/3feee27d873ae2297b8e2370a7082aad. Are you okay with that? |
rock and roll |
Fixed static code analysis errors.
Added check to make sure $files isn't false when sorting the array. Otherwise, we return an empty array.
Ignore coverage for the last line of the globstar function, since it's only used if the glob function returns an error. Added a test to validate the behaviour of the globstar function when passing non existant glob pattern. Fixed code using php-cs-fixer. Fixed error reported by phpstan.
I was having a pretty hard time with the GitHub checks until I realized that the tools used were in the |
Would love to see this land in PHPUnit! |
Summary
Added support for globstar pattern when resolving paths in the FileIterator Factory.
A globstar can now be added to a filter's path to recursively search for a given directory in a structure. The globstar can be use like that:
This pattern will look into every directory under
root_directory
, recursively, and return the path of eachtarget_directory
present in the structure.Fixes #82