You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
1.1 KiB

3 years ago
  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. '@PSR2' => 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. 'method_argument_space' => [
  28. 'on_multiline' => 'ensure_fully_multiline',
  29. 'keep_multiple_spaces_after_comma' => true,
  30. ],
  31. 'single_trait_insert_per_statement' => true,
  32. ])
  33. ->setFinder($finder);