.php_cs.dist 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?php
  2. $finder = PhpCsFixer\Finder::create()
  3. ->path('src')->name('*.php')
  4. ->path('tests')->name('*.php')
  5. ->notPath('tests/Fixtures')
  6. ->in(__DIR__)
  7. ;
  8. return PhpCsFixer\Config::create()
  9. ->setRules([
  10. '@PSR2' => true,
  11. 'array_syntax' => ['syntax' => 'short'],
  12. 'no_unused_imports' => true,
  13. 'blank_line_before_statement' => ['statements' => ['return']],
  14. 'cast_spaces' => ['space' => 'single'],
  15. 'concat_space' => true,
  16. 'declare_strict_types' => true,
  17. 'function_typehint_space' => true,
  18. 'lowercase_cast' => true,
  19. 'magic_constant_casing' => true,
  20. 'method_separation' => true,
  21. 'single_blank_line_before_namespace' => true,
  22. 'no_singleline_whitespace_before_semicolons' => true,
  23. 'no_spaces_around_offset' => true,
  24. 'no_unused_imports' => true,
  25. 'no_whitespace_before_comma_in_array' => true,
  26. 'no_whitespace_in_blank_line' => true,
  27. 'object_operator_without_whitespace' => true,
  28. 'single_quote' => true,
  29. 'method_separation' => true,
  30. 'no_blank_lines_after_phpdoc' => true,
  31. 'no_extra_consecutive_blank_lines' => true,
  32. 'return_type_declaration' => ['space_before' => 'none'],
  33. 'no_trailing_comma_in_list_call' => true,
  34. 'no_trailing_comma_in_singleline_array' => true,
  35. 'no_unneeded_control_parentheses' => true,
  36. 'no_unneeded_curly_braces' => true,
  37. 'ordered_imports' => true,
  38. 'short_scalar_cast' => true,
  39. 'space_after_semicolon' => true,
  40. 'ternary_operator_spaces' => true,
  41. 'trailing_comma_in_multiline_array' => true,
  42. 'trim_array_spaces' => true,
  43. 'no_empty_phpdoc' => true,
  44. 'no_superfluous_phpdoc_tags' => true,
  45. 'phpdoc_align' => true,
  46. 'phpdoc_inline_tag' => true,
  47. 'phpdoc_annotation_without_dot' => true,
  48. 'phpdoc_indent' => true,
  49. 'phpdoc_var_without_name' => true,
  50. 'phpdoc_types' => true,
  51. 'phpdoc_types_order' => true,
  52. 'phpdoc_trim' => true,
  53. 'phpdoc_to_comment' => true,
  54. 'phpdoc_summary' => true,
  55. 'phpdoc_single_line_var_spacing' => true,
  56. 'phpdoc_separation' => true,
  57. 'phpdoc_scalar' => true,
  58. 'phpdoc_no_useless_inheritdoc' => true,
  59. 'phpdoc_no_empty_return' => true,
  60. 'phpdoc_no_alias_tag' => true,
  61. 'phpdoc_order' => true,
  62. 'phpdoc_var_annotation_correct_order' => true,
  63. 'phpdoc_var_without_name' => true,
  64. ])
  65. ->setFinder($finder)
  66. ;