.php-cs-fixer.php 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <?php
  2. declare(strict_types=1);
  3. return (new PhpCsFixer\Config())
  4. ->setRiskyAllowed(true)
  5. ->setRules([
  6. '@DoctrineAnnotation' => true,
  7. '@Symfony' => true,
  8. '@Symfony:risky' => true,
  9. '@PHPUnit75Migration:risky' => true,
  10. '@PHP71Migration' => true,
  11. '@PHP70Migration:risky' => true, // @TODO with next major version
  12. 'align_multiline_comment' => ['comment_type' => 'all_multiline'],
  13. 'array_indentation' => true,
  14. 'array_syntax' => ['syntax' => 'short'],
  15. 'binary_operator_spaces' => ['default' => 'align_single_space'],
  16. 'blank_line_before_statement' => true,
  17. 'class_definition' => ['single_item_single_line' => true],
  18. 'compact_nullable_typehint' => true,
  19. 'concat_space' => ['spacing' => 'one'],
  20. 'echo_tag_syntax' => ['format' => 'long'],
  21. 'error_suppression' => false,
  22. 'escape_implicit_backslashes' => true,
  23. 'explicit_indirect_variable' => true,
  24. 'explicit_string_variable' => true,
  25. 'fully_qualified_strict_types' => true,
  26. 'heredoc_to_nowdoc' => true,
  27. 'list_syntax' => ['syntax' => 'long'],
  28. 'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline'],
  29. 'method_chaining_indentation' => true,
  30. 'multiline_comment_opening_closing' => true,
  31. 'multiline_whitespace_before_semicolons' => ['strategy' => 'new_line_for_chained_calls'],
  32. 'native_constant_invocation' => true,
  33. 'native_function_invocation' => ['include' => ['@internal']],
  34. 'no_alternative_syntax' => true,
  35. 'no_break_comment' => true,
  36. 'no_extra_blank_lines' => ['tokens' => ['break', 'continue', 'extra', 'return', 'throw', 'use', 'parenthesis_brace_block', 'square_brace_block', 'curly_brace_block']],
  37. 'no_null_property_initialization' => true,
  38. 'no_php4_constructor' => true,
  39. 'no_superfluous_elseif' => true,
  40. 'no_unneeded_curly_braces' => true,
  41. 'no_unneeded_final_method' => true,
  42. 'no_unreachable_default_argument_value' => true,
  43. 'no_useless_else' => true,
  44. 'no_useless_return' => true,
  45. 'ordered_imports' => true,
  46. 'php_unit_method_casing' => true,
  47. 'php_unit_set_up_tear_down_visibility' => true,
  48. 'php_unit_strict' => true,
  49. 'php_unit_test_annotation' => true,
  50. 'php_unit_test_case_static_method_calls' => true,
  51. 'php_unit_test_class_requires_covers' => false,
  52. 'phpdoc_add_missing_param_annotation' => true,
  53. 'phpdoc_order' => true,
  54. 'phpdoc_order_by_value' => true,
  55. 'phpdoc_types_order' => true,
  56. 'random_api_migration' => true,
  57. 'semicolon_after_instruction' => true,
  58. 'simplified_null_return' => true,
  59. 'single_line_comment_style' => true,
  60. 'single_line_throw' => false,
  61. 'space_after_semicolon' => true,
  62. 'static_lambda' => true,
  63. 'strict_comparison' => true,
  64. 'string_line_ending' => true,
  65. ])
  66. ->setFinder(
  67. PhpCsFixer\Finder::create()
  68. ->in(__DIR__ . '/src')
  69. ->in(__DIR__ . '/tests')
  70. )
  71. ;