.php_cs 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <?php
  2. use PhpCsFixer\Config;
  3. use PhpCsFixer\Finder;
  4. return Config::create()
  5. ->setRules
  6. ([
  7. 'array_syntax' => ['syntax' => 'short'],
  8. 'blank_line_after_namespace' => true,
  9. 'blank_line_after_opening_tag' => true,
  10. 'cast_spaces' => true,
  11. 'combine_nested_dirname' => true,
  12. 'concat_space' => ['spacing' => 'one'],
  13. 'elseif' => true,
  14. 'encoding' => true,
  15. 'full_opening_tag' => true,
  16. 'function_declaration' => ['closure_function_spacing' => 'none'],
  17. 'function_to_constant' => true,
  18. 'function_typehint_space' => true,
  19. 'linebreak_after_opening_tag' => true,
  20. 'list_syntax' => ['syntax' => 'short'],
  21. 'logical_operators' => true,
  22. 'lowercase_cast' => true,
  23. 'lowercase_constants' => true,
  24. 'lowercase_keywords' => true,
  25. 'lowercase_static_reference' => true,
  26. 'magic_constant_casing' => true,
  27. 'magic_method_casing' => true,
  28. 'method_argument_space' => true,
  29. 'native_function_casing' => true,
  30. 'no_alias_functions' => true,
  31. 'no_blank_lines_after_phpdoc' => true,
  32. 'no_closing_tag' => true,
  33. 'no_empty_statement' => true,
  34. 'no_extra_blank_lines' => true,
  35. 'no_leading_import_slash' => true,
  36. 'no_leading_namespace_whitespace' => true,
  37. 'no_singleline_whitespace_before_semicolons' => true,
  38. 'no_spaces_inside_parenthesis' => true,
  39. 'no_trailing_comma_in_list_call' => true,
  40. 'no_trailing_comma_in_singleline_array' => true,
  41. 'no_trailing_whitespace_in_comment' => true,
  42. 'no_trailing_whitespace' => true,
  43. 'no_unused_imports' => true,
  44. 'no_whitespace_before_comma_in_array' => true,
  45. 'no_whitespace_in_blank_line' => true,
  46. 'non_printable_character' => true,
  47. 'normalize_index_brace' => true,
  48. 'object_operator_without_whitespace' => true,
  49. 'ordered_imports' => ['imports_order' => ['class', 'function', 'const']],
  50. 'phpdoc_align' => true,
  51. 'phpdoc_indent' => true,
  52. 'phpdoc_no_access' => true,
  53. 'phpdoc_order' => true,
  54. 'phpdoc_scalar' => true,
  55. 'phpdoc_summary' => true,
  56. 'phpdoc_to_comment' => true,
  57. 'phpdoc_trim' => true,
  58. 'phpdoc_types' => true,
  59. 'pow_to_exponentiation' => true,
  60. 'return_type_declaration' => true,
  61. 'short_scalar_cast' => true,
  62. 'simple_to_complex_string_variable' => true,
  63. 'single_blank_line_at_eof' => true,
  64. 'single_blank_line_before_namespace' => true,
  65. 'single_import_per_statement' => true,
  66. 'single_line_after_imports' => true,
  67. 'single_line_comment_style' => ['comment_types' => ['hash']],
  68. 'single_quote' => true,
  69. 'space_after_semicolon' => true,
  70. 'standardize_not_equals' => true,
  71. 'switch_case_semicolon_to_colon' => true,
  72. 'switch_case_space' => true,
  73. 'trailing_comma_in_multiline_array' => true,
  74. 'trim_array_spaces' => true,
  75. 'visibility_required' => true,
  76. 'void_return' => true,
  77. 'whitespace_after_comma_in_array' => true,
  78. ])
  79. ->setRiskyAllowed(true)
  80. ->setFinder(Finder::create()->in(__DIR__));