.php-cs-fixer.dist.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. $header = <<<'EOF'
  13. This file is part of PHP CS Fixer.
  14. (c) Fabien Potencier <fabien@symfony.com>
  15. Dariusz Rumiński <dariusz.ruminski@gmail.com>
  16. This source file is subject to the MIT license that is bundled
  17. with this source code in the file LICENSE.
  18. EOF;
  19. $finder = PhpCsFixer\Finder::create()
  20. ->ignoreDotFiles(false)
  21. ->ignoreVCSIgnored(true)
  22. ->exclude(['dev-tools/phpstan', 'tests/Fixtures'])
  23. ->in(__DIR__)
  24. ;
  25. $config = new PhpCsFixer\Config();
  26. $config
  27. ->setRiskyAllowed(true)
  28. ->setRules([
  29. '@PHP74Migration' => true,
  30. '@PHP74Migration:risky' => true,
  31. '@PHPUnit100Migration:risky' => true,
  32. '@PhpCsFixer' => true,
  33. '@PhpCsFixer:risky' => true,
  34. 'general_phpdoc_annotation_remove' => ['annotations' => ['expectedDeprecation']], // one should use PHPUnit built-in method instead
  35. 'header_comment' => ['header' => $header],
  36. 'heredoc_indentation' => false, // TODO switch on when # of PR's is lower
  37. 'modernize_strpos' => true, // needs PHP 8+ or polyfill
  38. 'no_useless_concat_operator' => false, // TODO switch back on when the `src/Console/Application.php` no longer needs the concat
  39. 'use_arrow_functions' => false, // TODO switch on when # of PR's is lower
  40. ])
  41. ->setFinder($finder)
  42. ;
  43. return $config;