Skip to content

Commit

Permalink
Merge pull request #60 from webmozarts/feature/remove-path-util-depen…
Browse files Browse the repository at this point in the history
…dency

Replaced `webmozart/path-util` dependency with `@internal` `Path::isAbsolute()`
  • Loading branch information
Ocramius authored Apr 5, 2022
2 parents 539b5db + 4b355c9 commit 287cba1
Show file tree
Hide file tree
Showing 8 changed files with 519 additions and 336 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- "7.3"
- "7.4"
- "8.0"
- "8.1-rc"
- "8.1"
operating-system:
- "ubuntu-latest"
- "windows-latest"
Expand Down
12 changes: 3 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,19 +114,13 @@ $iterator = new GlobFilterIterator(

Relative globs such as `*.css` are not supported. Usually, such globs refer to
paths relative to the current working directory. This utility, however, does not
want to make such assumptions. Hence you should always pass absolute globs.

If you want to allow users to pass relative globs, I recommend to turn the globs
into absolute globs using the [Webmozart Path Utility]:
want to make such assumptions. Hence you should always pass absolute globs, so
usage of `__DIR__` is encouraged:

```php
use Webmozart\Glob\Glob;
use Webmozart\PathUtil\Path;

// If $glob is absolute, that glob is used without modification.
// If $glob is relative, it is turned into an absolute path based on the current
// working directory.
$paths = Glob::glob(Path::makeAbsolute($glob, getcwd());
$paths = Glob::glob(__DIR__ . '/*');
```

### Windows Compatibility
Expand Down
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
}
],
"require": {
"php": "^7.3 || ^8.0.0",
"webmozart/path-util": "^2.2"
"php": "^7.3 || ^8.0.0"
},
"require-dev": {
"symfony/filesystem": "^5.3",
Expand Down
Loading

0 comments on commit 287cba1

Please sign in to comment.