.php-cs-fixer.dist.php 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. $finder = Symfony\Component\Finder\Finder::create()
  3. ->in([
  4. __DIR__ . '/src',
  5. __DIR__ . '/tests',
  6. ])
  7. ->name('*.php')
  8. ->ignoreDotFiles(true)
  9. ->ignoreVCS(true);
  10. return (new PhpCsFixer\Config())
  11. ->setRules([
  12. '@PSR12' => true,
  13. 'array_syntax' => ['syntax' => 'short'],
  14. 'ordered_imports' => ['sort_algorithm' => 'alpha'],
  15. 'no_unused_imports' => true,
  16. 'not_operator_with_successor_space' => true,
  17. 'trailing_comma_in_multiline' => true,
  18. 'ternary_to_null_coalescing' => true,
  19. 'phpdoc_scalar' => true,
  20. 'unary_operator_spaces' => true,
  21. 'binary_operator_spaces' => true,
  22. 'blank_line_before_statement' => [
  23. 'statements' => ['break', 'continue', 'declare', 'return', 'throw', 'try'],
  24. ],
  25. 'phpdoc_single_line_var_spacing' => true,
  26. 'phpdoc_var_without_name' => true,
  27. 'class_attributes_separation' => [
  28. 'elements' => ['const' => 'one', 'method' => 'one', 'property' => 'one', 'trait_import' => 'none', 'case' => 'none'],
  29. ],
  30. ])
  31. ->setFinder($finder);