.php_cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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 PhpCsFixer\Config::create()
  16. ->setRules([
  17. '@PSR2' => true,
  18. 'array_syntax' => ['syntax' => 'short'],
  19. 'ordered_imports' => ['sortAlgorithm' => 'alpha'],
  20. 'no_unused_imports' => true,
  21. 'not_operator_with_successor_space' => true,
  22. 'trailing_comma_in_multiline_array' => 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. 'method_argument_space' => [
  32. 'on_multiline' => 'ensure_fully_multiline',
  33. 'keep_multiple_spaces_after_comma' => true,
  34. ]
  35. ])
  36. ->setFinder($finder);