.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. $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. 'modernize_strpos' => true, // needs PHP 8+ or polyfill
  37. 'no_useless_concat_operator' => false, // TODO switch back on when the `src/Console/Application.php` no longer needs the concat
  38. ])
  39. ->setFinder($finder)
  40. ;
  41. return $config;