.php-cs-fixer.dist.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. declare(strict_types=1);
  3. /*
  4. * This file is part of PHP CS Fixer.
  5. *
  6. * (c) Fabien Potencier <fabien@symfony.com>
  7. * Dariusz Rumiński <dariusz.ruminski@gmail.com>
  8. *
  9. * This source file is subject to the MIT license that is bundled
  10. * with this source code in the file LICENSE.
  11. */
  12. use PhpCsFixer\Config;
  13. use PhpCsFixer\Finder;
  14. use PhpCsFixer\Runner\Parallel\ParallelConfigFactory;
  15. return (new Config())
  16. ->setParallelConfig(ParallelConfigFactory::detect()) // @TODO 4.0 no need to call this manually
  17. ->setRiskyAllowed(true)
  18. ->setRules([
  19. '@PHP74Migration' => true,
  20. '@PHP74Migration:risky' => true,
  21. '@PHPUnit100Migration:risky' => true,
  22. '@PhpCsFixer' => true,
  23. '@PhpCsFixer:risky' => true,
  24. 'general_phpdoc_annotation_remove' => ['annotations' => ['expectedDeprecation']], // one should use PHPUnit built-in method instead
  25. 'header_comment' => ['header' => <<<'EOF'
  26. This file is part of PHP CS Fixer.
  27. (c) Fabien Potencier <fabien@symfony.com>
  28. Dariusz Rumiński <dariusz.ruminski@gmail.com>
  29. This source file is subject to the MIT license that is bundled
  30. with this source code in the file LICENSE.
  31. EOF],
  32. 'modernize_strpos' => true, // needs PHP 8+ or polyfill
  33. 'no_useless_concat_operator' => false, // TODO switch back on when the `src/Console/Application.php` no longer needs the concat
  34. 'numeric_literal_separator' => true,
  35. 'string_implicit_backslashes' => true, // https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/pull/7786
  36. ])
  37. ->setFinder(
  38. (new Finder())
  39. ->ignoreDotFiles(false)
  40. ->ignoreVCSIgnored(true)
  41. ->exclude(['dev-tools/phpstan', 'tests/Fixtures'])
  42. ->in(__DIR__)
  43. )
  44. ;