Skip to content

Commit

Permalink
DX: Improve internal dist config for Fixer (#7952)
Browse files Browse the repository at this point in the history
  • Loading branch information
Wirone committed Apr 16, 2024
1 parent f40f18e commit 28209a2
Showing 1 changed file with 16 additions and 19 deletions.
35 changes: 16 additions & 19 deletions .php-cs-fixer.dist.php
Expand Up @@ -15,23 +15,6 @@
use PhpCsFixer\Config;
use PhpCsFixer\Finder;

$header = <<<'EOF'
This file is part of PHP CS Fixer.
(c) Fabien Potencier <fabien@symfony.com>
Dariusz Rumiński <dariusz.ruminski@gmail.com>
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([
Expand All @@ -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 <fabien@symfony.com>
Dariusz Rumiński <dariusz.ruminski@gmail.com>

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__)
)
;

0 comments on commit 28209a2

Please sign in to comment.