diff --git a/.gitignore b/.gitignore index b2667fc9503..10389658082 100644 --- a/.gitignore +++ b/.gitignore @@ -14,7 +14,7 @@ # PHP-CS-Fixer /.php-cs-fixer.php -/.php-cs-fixer.cache* +/.php-cs-fixer.cache # Psalm /.psalm/cache diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 29fd83f9637..6674f6f84bc 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -335,10 +335,6 @@ 'whitespace_after_comma_in_array' => true, ]); -$branch = @trim((string) @shell_exec('git rev-parse --abbrev-ref HEAD')); - -if (!empty($branch)) { - $config->setCacheFile(__DIR__ . '/.php-cs-fixer.cache.' . $branch); -} +$config->setCacheFile(__DIR__ . '/.php-cs-fixer.cache/' . sha1(@trim((string) @shell_exec('git rev-parse --abbrev-ref HEAD')))); return $config;