Open zeshanziya opened 5 months ago
Can you share more information here? Which version of GrumPHP? What was the pattern that you had to fix? Do you have to fix it for all tools or only some of them?
I checked, and it's present in all GrumPHP versions. Yes for all tools ignore_patterns
paths. Following are my observations.
So if a path starts with /
and ends with /
and has multiple directories, it generates a warning.
Examples:
/config/
works fine
/web/sites/default/
generates a warning
web/sites/default/
works fine
/web/sites/default
works fine
So, these patterns are always regexes. As explained in this comment, we must escape the slashes.
This means it is not a bug but we should document this better.
Also, the explanation for why paths with slashes inside the string work is in this function.
I have noticed that when paths in
ignore_patterns
have a/
at the end, it generates the following warning while running GrumPHP:PHP Warning: preg_match(): Unknown modifier 't' in phar:///var/www/html/vendor/phpro/grumphp-shim/grumphp.phar/vendor/symfony/finder/Iterator/MultiplePcreFilterIterator.php on line 53
Solutions: Fix paths for
ignore_patterns
ingrumphp.yml.dist