.php_cs.dist 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. $config = PhpCsFixer\Config::create()
  3. ->setRiskyAllowed(true)
  4. ->setRules([
  5. '@PSR2' => true,
  6. 'array_syntax' => ['syntax' => 'short'],
  7. 'concat_space' => ['spacing' => 'one'],
  8. 'declare_strict_types' => false,
  9. 'final_static_access' => true,
  10. 'fully_qualified_strict_types' => true,
  11. 'header_comment' => false,
  12. 'is_null' => ['use_yoda_style' => true],
  13. 'list_syntax' => ['syntax' => 'long'],
  14. 'lowercase_cast' => true,
  15. 'magic_method_casing' => true,
  16. 'modernize_types_casting' => true,
  17. 'multiline_comment_opening_closing' => true,
  18. 'no_alias_functions' => true,
  19. 'no_alternative_syntax' => true,
  20. 'no_blank_lines_after_phpdoc' => true,
  21. 'no_empty_comment' => true,
  22. 'no_empty_phpdoc' => true,
  23. 'no_empty_statement' => true,
  24. 'no_extra_blank_lines' => true,
  25. 'no_leading_import_slash' => true,
  26. 'no_trailing_comma_in_singleline_array' => true,
  27. 'no_unset_cast' => true,
  28. 'no_unused_imports' => true,
  29. 'no_whitespace_in_blank_line' => true,
  30. 'ordered_imports' => true,
  31. 'php_unit_ordered_covers' => true,
  32. 'php_unit_test_annotation' => ['style' => 'prefix'],
  33. 'php_unit_test_case_static_method_calls' => ['call_type' => 'self'],
  34. 'phpdoc_align' => ['align' => 'vertical'],
  35. 'phpdoc_no_useless_inheritdoc' => true,
  36. 'phpdoc_scalar' => true,
  37. 'phpdoc_separation' => true,
  38. 'phpdoc_single_line_var_spacing' => true,
  39. 'phpdoc_trim' => true,
  40. 'phpdoc_trim_consecutive_blank_line_separation' => true,
  41. 'phpdoc_types' => true,
  42. 'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'],
  43. 'phpdoc_var_without_name' => true,
  44. 'single_trait_insert_per_statement' => true,
  45. 'standardize_not_equals' => true,
  46. ])
  47. ->setFinder(
  48. PhpCsFixer\Finder::create()
  49. ->in(__DIR__.'/src')
  50. ->in(__DIR__.'/tests')
  51. ->name('*.php')
  52. )
  53. ;
  54. return $config;