.php-cs-fixer.dist.php 1008 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. $finder = PhpCsFixer\Finder::create()
  3. ->exclude('PhpParser/Parser')
  4. ->in(__DIR__ . '/lib')
  5. ->in(__DIR__ . '/test')
  6. ->in(__DIR__ . '/grammar')
  7. ;
  8. $config = new PhpCsFixer\Config();
  9. return $config->setRiskyAllowed(true)
  10. ->setRules([
  11. '@PSR12' => true,
  12. // We use PSR12 with consistent brace placement.
  13. 'curly_braces_position' => [
  14. 'functions_opening_brace' => 'same_line',
  15. 'classes_opening_brace' => 'same_line',
  16. ],
  17. // declare(strict_types=1) on the same line as <?php.
  18. 'blank_line_after_opening_tag' => false,
  19. 'declare_strict_types' => true,
  20. // Keep argument formatting for now.
  21. 'method_argument_space' => ['on_multiline' => 'ignore'],
  22. 'phpdoc_align' => ['align' => 'left'],
  23. 'phpdoc_trim' => true,
  24. 'no_empty_phpdoc' => true,
  25. 'no_superfluous_phpdoc_tags' => ['allow_mixed' => true],
  26. 'no_extra_blank_lines' => true,
  27. ])
  28. ->setFinder($finder)
  29. ;