.php-cs-fixer.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. $finder = Symfony\Component\Finder\Finder::create()
  3. ->notPath('bootstrap/*')
  4. ->notPath('storage/*')
  5. ->notPath('resources/view/mail/*')
  6. ->in([
  7. __DIR__ . '/src',
  8. __DIR__ . '/tests',
  9. ])
  10. ->name('*.php')
  11. ->notName('*.blade.php')
  12. ->notName('GitConflictController.php')
  13. ->ignoreDotFiles(true)
  14. ->ignoreVCS(true);
  15. return (new PhpCsFixer\Config())
  16. ->setRules([
  17. '@PSR12' => true,
  18. 'array_syntax' => ['syntax' => 'short'],
  19. 'ordered_imports' => ['sort_algorithm' => 'alpha'],
  20. 'no_unused_imports' => true,
  21. 'not_operator_with_successor_space' => true,
  22. 'trailing_comma_in_multiline' => true,
  23. 'phpdoc_scalar' => true,
  24. 'unary_operator_spaces' => true,
  25. 'binary_operator_spaces' => true,
  26. 'blank_line_before_statement' => [
  27. 'statements' => ['break', 'continue', 'declare', 'return', 'throw', 'try'],
  28. ],
  29. 'phpdoc_single_line_var_spacing' => true,
  30. 'phpdoc_var_without_name' => true,
  31. 'class_attributes_separation' => [
  32. 'elements' => [
  33. 'method' => 'one',
  34. ],
  35. ],
  36. 'method_argument_space' => [
  37. 'on_multiline' => 'ensure_fully_multiline',
  38. 'keep_multiple_spaces_after_comma' => true,
  39. ],
  40. 'single_trait_insert_per_statement' => true,
  41. ])
  42. ->setFinder($finder);