.php-cs-fixer.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. declare(strict_types=1);
  3. return (new PhpCsFixer\Config())
  4. ->setRiskyAllowed(true)
  5. ->setRules([
  6. '@PSR12' => true,
  7. '@Symfony' => true,
  8. '@PhpCsFixer' => true,
  9. 'array_syntax' => [
  10. 'syntax' => 'short',
  11. ],
  12. 'list_syntax' => [
  13. 'syntax' => 'short',
  14. ],
  15. 'concat_space' => [
  16. 'spacing' => 'one',
  17. ],
  18. 'blank_line_before_statement' => [
  19. 'statements' => [
  20. 'declare',
  21. ],
  22. ],
  23. 'ordered_imports' => [
  24. 'imports_order' => [
  25. 'class',
  26. 'function',
  27. 'const',
  28. ],
  29. 'sort_algorithm' => 'alpha',
  30. ],
  31. 'single_line_comment_style' => [
  32. 'comment_types' => [
  33. ],
  34. ],
  35. 'yoda_style' => [
  36. 'always_move_variable' => false,
  37. 'equal' => false,
  38. 'identical' => false,
  39. ],
  40. 'multiline_whitespace_before_semicolons' => [
  41. 'strategy' => 'no_multi_line',
  42. ],
  43. 'constant_case' => [
  44. 'case' => 'lower',
  45. ],
  46. 'class_attributes_separation' => true,
  47. 'combine_consecutive_unsets' => true,
  48. 'declare_strict_types' => true,
  49. 'linebreak_after_opening_tag' => true,
  50. 'lowercase_static_reference' => true,
  51. 'no_useless_else' => true,
  52. 'no_unused_imports' => true,
  53. 'not_operator_with_successor_space' => false,
  54. 'not_operator_with_space' => false,
  55. 'ordered_class_elements' => true,
  56. 'php_unit_strict' => false,
  57. 'phpdoc_separation' => false,
  58. 'single_quote' => true,
  59. 'standardize_not_equals' => true,
  60. 'multiline_comment_opening_closing' => true,
  61. 'phpdoc_summary' => false,
  62. 'php_unit_test_class_requires_covers' => false,
  63. 'phpdoc_var_without_name' => false,
  64. ])
  65. ->setFinder(
  66. PhpCsFixer\Finder::create()->in(__DIR__ . '/src')
  67. );