webmozarts / glob

A PHP implementation of Ant's glob.
MIT License
253 stars 16 forks source link

Package webmozart/path-util is abandoned, you should avoid using it. Use symfony/filesystem instead. #57

Closed DanielBadura closed 2 years ago

DanielBadura commented 2 years ago

Just porting the issue from https://github.com/maglnet/ComposerRequireChecker/issues/315 and quoting @Ocramius:

FWIW, if there's a non-symfony solution to that, it could be a better approach: mostly worried about dwindling package quality and continuously increasing dependency ranges in symfony/*.

I dont know another non-symfony package that is doing the stuff needed. Only used path-util / glob or filesystem / finder, so suggestions welcome i guess 👯

webmozart commented 2 years ago

Wouldn't it make more sense to feed that back to Symfony instead? Excluding Symfony dependencies on principle sounds exuberant to me (I'm trying hard not to say "crazy").

Ocramius commented 2 years ago

TBH, since symfony has gone completely wrong from a dependency PoV (see https://github.com/symfony/symfony/pull/36876), and to not introduce a circular dependency for a tiny use-case scenario, it's best to break the dependency graph here, and avoid the dependency overall.

The only use-cases are:

https://github.com/webmozarts/glob/blob/088aea5388f0325c2da9a9bb30de9546049e4ca4/src/Glob.php#L316-L321 https://github.com/webmozarts/glob/blob/088aea5388f0325c2da9a9bb30de9546049e4ca4/src/Glob.php#L461-L466

A dependency for that is avoidable.

In fact, dragging in pre-existing code and tests from webmozarts/path-util is preferable:

https://github.com/webmozart/path-util/blob/6099b5238073f87f246863fd58c2e447acfc0d24/src/Path.php#L487-L519

webmozart commented 2 years ago

Thanks, I missed that "discussion" :wink: That comment explains it pretty well though and it makes sense to me:

Please note that Symfony's promise is to have support for all new PHP versions in all versions that aren't yet end-of-life. This means that if 3.4.40 doesn't support PHP 8, 3.4.41 will.

Anyways, since the touchpoint is so small, I understand that it makes sense not to introduce the library at all.

Ocramius commented 2 years ago

Please note that Symfony's promise is to have support for all new PHP versions in all versions that aren't yet end-of-life. This means that if 3.4.40 doesn't support PHP 8, 3.4.41 will.

FWIW, I'm 4h in in trying to fix some issues with the lax dependency requirements of symfony (on a separate private project): my trust in anything symfony/* has grown extremely thin.

Ocramius commented 2 years ago

Removed dependency in #60