From 28209a2da0f739e638564c1678ac2d94a8de43ac Mon Sep 17 00:00:00 2001 From: Greg Korba Date: Tue, 16 Apr 2024 19:54:21 +0200 Subject: [PATCH] DX: Improve internal dist config for Fixer (#7952) --- .php-cs-fixer.dist.php | 35 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 9a283beca9c..e16e47480cc 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -15,23 +15,6 @@ use PhpCsFixer\Config; use PhpCsFixer\Finder; -$header = <<<'EOF' - This file is part of PHP CS Fixer. - - (c) Fabien Potencier - Dariusz Rumiński - - This source file is subject to the MIT license that is bundled - with this source code in the file LICENSE. - EOF; - -$finder = (new Finder()) - ->ignoreDotFiles(false) - ->ignoreVCSIgnored(true) - ->exclude(['dev-tools/phpstan', 'tests/Fixtures']) - ->in(__DIR__) -; - return (new Config()) ->setRiskyAllowed(true) ->setRules([ @@ -41,10 +24,24 @@ '@PhpCsFixer' => true, '@PhpCsFixer:risky' => true, 'general_phpdoc_annotation_remove' => ['annotations' => ['expectedDeprecation']], // one should use PHPUnit built-in method instead - 'header_comment' => ['header' => $header], + 'header_comment' => ['header' => <<<'EOF' + This file is part of PHP CS Fixer. + + (c) Fabien Potencier + Dariusz Rumiński + + This source file is subject to the MIT license that is bundled + with this source code in the file LICENSE. + EOF], 'modernize_strpos' => true, // needs PHP 8+ or polyfill 'no_useless_concat_operator' => false, // TODO switch back on when the `src/Console/Application.php` no longer needs the concat 'numeric_literal_separator' => true, ]) - ->setFinder($finder) + ->setFinder( + (new Finder()) + ->ignoreDotFiles(false) + ->ignoreVCSIgnored(true) + ->exclude(['dev-tools/phpstan', 'tests/Fixtures']) + ->in(__DIR__) + ) ;