For configuration or updating questions please read the README and UPGRADE documentation,
or visit: https://gitter.im/PHP-CS-Fixer
When reporting an issue (bug) please provide the following information:
$ php -v):=> 7.2.11
$ php-cs-fixer -V):=>2.14.2
=> php php-cs-fixer.phar --verbose fix --dry-run
=> ....................................
$finder = PhpCsFixer\Finder::create()
->exclude('bootstrap/cache')
->in([
'bootstrap',
]);
return PhpCsFixer\Config::create()
->setRules([
// many rules
],
])->setRiskyAllowed(true)->setFinder($finder);
=> n/a
=> ....................................
$ php php-cs-fixer.phar --verbose fix --dry-run
Loaded config default from "C:\mypath\www\.php_cs".
Using cache file ".php_cs.cache".
SFFSS
Legend: ?-unknown, I-invalid file syntax, file ignored, S-Skipped, .-no changes, F-fixed, E-error
1) bootstrap\cache\packages.php (...)
2) bootstrap\cache\services.php (...)
Checked all files in 0.084 seconds, 12.000 MB memory used
When using exclude you have to use relative path: https://api.symfony.com/4.0/Symfony/Component/Finder/Finder.html#method_exclude
So replace ->exclude('bootstrap/cache') with ->exclude('cache') and it will work.
Closing as answered. Feel free to continue discussion, anyway
Oh, makes sense. Thanks for pointing it out.
What if I want to include a and b including a/c but not b/c?
What if I want to exclude only a/c and not a/b/c?
Also the path seems to change when switching to and from cache?