.php_cs.dist 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <?php
  2. $finder = PhpCsFixer\Finder::create()
  3. ->in([__DIR__ . '/lib', __DIR__ . '/tests']);
  4. return PhpCsFixer\Config::create()
  5. ->setRules([
  6. '@PSR2' => true,
  7. 'array_syntax' => ['syntax' => 'short'],
  8. 'binary_operator_spaces' => true,
  9. 'blank_line_before_return' => true,
  10. 'cast_spaces' => true,
  11. 'concat_space' => ['spacing' => 'one'],
  12. 'function_typehint_space' => true,
  13. 'general_phpdoc_annotation_remove' => ['author'],
  14. 'linebreak_after_opening_tag' => true,
  15. 'lowercase_cast' => true,
  16. 'mb_str_functions' => true,
  17. 'method_separation' => true,
  18. 'native_function_casing' => true,
  19. 'new_with_braces' => true,
  20. 'no_alias_functions' => true,
  21. 'no_blank_lines_after_class_opening' => true,
  22. 'no_blank_lines_after_phpdoc' => true,
  23. 'no_empty_comment' => true,
  24. 'no_empty_phpdoc' => true,
  25. 'no_empty_statement' => true,
  26. 'no_extra_consecutive_blank_lines' => [
  27. 'use',
  28. 'break',
  29. 'continue',
  30. 'extra',
  31. 'return',
  32. 'throw',
  33. 'useTrait',
  34. 'curly_brace_block',
  35. 'parenthesis_brace_block',
  36. 'square_brace_block',
  37. ],
  38. 'no_leading_import_slash' => true,
  39. 'no_leading_namespace_whitespace' => true,
  40. 'no_singleline_whitespace_before_semicolons' => true,
  41. 'no_trailing_comma_in_singleline_array' => true,
  42. 'no_unreachable_default_argument_value' => true,
  43. 'no_unused_imports' => true,
  44. 'no_useless_else' => true,
  45. 'no_useless_return' => true,
  46. 'no_whitespace_in_blank_line' => true,
  47. 'object_operator_without_whitespace' => true,
  48. 'ordered_class_elements' => true,
  49. 'ordered_imports' => true,
  50. 'php_unit_construct' => true,
  51. 'php_unit_dedicate_assert' => true,
  52. 'php_unit_expectation' => true,
  53. 'php_unit_mock' => true,
  54. 'php_unit_no_expectation_annotation' => true,
  55. 'phpdoc_add_missing_param_annotation' => true,
  56. 'phpdoc_indent' => true,
  57. 'phpdoc_no_access' => true,
  58. 'phpdoc_no_empty_return' => true,
  59. 'phpdoc_no_package' => true,
  60. 'phpdoc_order' => true,
  61. 'phpdoc_scalar' => true,
  62. 'phpdoc_single_line_var_spacing' => true,
  63. 'phpdoc_trim' => true,
  64. 'phpdoc_types' => true,
  65. 'psr4' => true,
  66. 'self_accessor' => true,
  67. 'short_scalar_cast' => true,
  68. 'single_blank_line_before_namespace' => true,
  69. 'single_quote' => true,
  70. 'space_after_semicolon' => true,
  71. 'standardize_not_equals' => true,
  72. 'ternary_operator_spaces' => true,
  73. 'trailing_comma_in_multiline_array' => true,
  74. 'trim_array_spaces' => true,
  75. 'unary_operator_spaces' => true,
  76. 'visibility_required' => true,
  77. 'whitespace_after_comma_in_array' => true,
  78. 'yoda_style' => false,
  79. ])
  80. ->setRiskyAllowed(true)
  81. ->setFinder($finder);