.php-cs-fixer.dist.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. $header = <<<'EOF'
  15. This file is part of PHP CS Fixer.
  16. (c) Fabien Potencier <fabien@symfony.com>
  17. Dariusz Rumiński <dariusz.ruminski@gmail.com>
  18. This source file is subject to the MIT license that is bundled
  19. with this source code in the file LICENSE.
  20. EOF;
  21. $finder = (new Finder())
  22. ->ignoreDotFiles(false)
  23. ->ignoreVCSIgnored(true)
  24. ->exclude(['dev-tools/phpstan', 'tests/Fixtures'])
  25. ->in(__DIR__)
  26. ;
  27. return (new Config())
  28. ->setRiskyAllowed(true)
  29. ->setRules([
  30. '@PHP74Migration' => true,
  31. '@PHP74Migration:risky' => true,
  32. '@PHPUnit100Migration:risky' => true,
  33. '@PhpCsFixer' => true,
  34. '@PhpCsFixer:risky' => true,
  35. 'general_phpdoc_annotation_remove' => ['annotations' => ['expectedDeprecation']], // one should use PHPUnit built-in method instead
  36. 'header_comment' => ['header' => $header],
  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. ])
  40. ->setFinder($finder)
  41. ;