.php_cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. return PhpCsFixer\Config::create()
  2. ->setRules([
  3. '@PSR2' => true,
  4. 'binary_operator_spaces' => true,
  5. 'blank_line_after_opening_tag' => true,
  6. 'compact_nullable_typehint' => true,
  7. 'declare_equal_normalize' => true,
  8. 'lowercase_cast' => true,
  9. 'lowercase_static_reference' => true,
  10. 'new_with_braces' => true,
  11. 'no_unused_imports' => true,
  12. 'no_blank_lines_after_class_opening' => true,
  13. 'no_leading_import_slash' => true,
  14. 'no_whitespace_in_blank_line' => true,
  15. 'ordered_class_elements' => [
  16. 'order' => [
  17. 'use_trait',
  18. ],
  19. ],
  20. 'ordered_imports' => [
  21. 'imports_order' => [
  22. 'class',
  23. 'function',
  24. 'const',
  25. ],
  26. 'sort_algorithm' => 'none',
  27. ],
  28. 'return_type_declaration' => true,
  29. 'short_scalar_cast' => true,
  30. 'single_blank_line_before_namespace' => true,
  31. 'single_trait_insert_per_statement' => true,
  32. 'ternary_operator_spaces' => true,
  33. 'unary_operator_spaces' => true,
  34. 'visibility_required' => [
  35. 'elements' => [
  36. 'const',
  37. 'method',
  38. 'property',
  39. ],
  40. ],
  41. ])
  42. ->setFinder(
  43. PhpCsFixer\Finder::create()
  44. ->exclude('vendor')
  45. ->in([__DIR__.'/src/'])
  46. )
  47. ;