.php_cs.dist.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. $finder = Symfony\Component\Finder\Finder::create()
  3. ->in([
  4. __DIR__ . '/src',
  5. __DIR__ . '/tests',
  6. ])
  7. ->name('*.php')
  8. ->notName('*.blade.php')
  9. ->ignoreDotFiles(true)
  10. ->ignoreVCS(true);
  11. return (new PhpCsFixer\Config())
  12. ->setRules([
  13. '@PSR12' => true,
  14. 'array_syntax' => ['syntax' => 'short'],
  15. 'ordered_imports' => ['sort_algorithm' => 'alpha'],
  16. 'no_unused_imports' => true,
  17. 'not_operator_with_successor_space' => true,
  18. 'trailing_comma_in_multiline' => 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' => [
  29. 'method' => 'one',
  30. ],
  31. ],
  32. 'method_argument_space' => [
  33. 'on_multiline' => 'ensure_fully_multiline',
  34. 'keep_multiple_spaces_after_comma' => true,
  35. ],
  36. 'single_trait_insert_per_statement' => true,
  37. ])
  38. ->setFinder($finder);