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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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 = (new PhpCsFixer\Finder())
  20. ->ignoreDotFiles(false)
  21. ->ignoreVCSIgnored(true)
  22. ->exclude(['dev-tools/phpstan', 'tests/Fixtures'])
  23. ->in(__DIR__)
  24. ;
  25. return (new PhpCsFixer\Config())
  26. ->setRiskyAllowed(true)
  27. ->setRules([
  28. '@PHP74Migration' => true,
  29. '@PHP74Migration:risky' => true,
  30. '@PHPUnit100Migration:risky' => true,
  31. '@PhpCsFixer' => true,
  32. '@PhpCsFixer:risky' => true,
  33. 'general_phpdoc_annotation_remove' => ['annotations' => ['expectedDeprecation']], // one should use PHPUnit built-in method instead
  34. 'header_comment' => ['header' => $header],
  35. 'modernize_strpos' => true, // needs PHP 8+ or polyfill
  36. 'no_useless_concat_operator' => false, // TODO switch back on when the `src/Console/Application.php` no longer needs the concat
  37. ])
  38. ->setFinder($finder)
  39. ;