菜谱项目

.php_cs.dist 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. use PhpCsFixer\Config;
  3. use PhpCsFixer\Finder;
  4. $rules = [
  5. '@PSR2' => true,
  6. 'array_syntax' => [
  7. 'syntax' => 'long',
  8. ],
  9. 'binary_operator_spaces' => [
  10. 'align_double_arrow' => false,
  11. 'align_equals' => false,
  12. ],
  13. 'blank_line_before_return' => true,
  14. 'cast_spaces' => true,
  15. 'concat_space' => [
  16. 'spacing' => 'none',
  17. ],
  18. 'ereg_to_preg' => true,
  19. 'method_separation' => true,
  20. 'no_blank_lines_after_phpdoc' => true,
  21. 'no_extra_consecutive_blank_lines' => true,
  22. 'no_short_bool_cast' => true,
  23. 'no_unneeded_control_parentheses' => true,
  24. 'no_unused_imports' => true,
  25. 'no_whitespace_in_blank_line' => true,
  26. 'ordered_imports' => true,
  27. 'phpdoc_align' => true,
  28. 'phpdoc_indent' => true,
  29. 'phpdoc_inline_tag' => true,
  30. 'phpdoc_no_access' => true,
  31. 'phpdoc_no_alias_tag' => [
  32. 'type' => 'var',
  33. ],
  34. 'phpdoc_no_package' => true,
  35. 'phpdoc_order' => true,
  36. 'phpdoc_scalar' => true,
  37. 'phpdoc_separation' => true,
  38. 'phpdoc_to_comment' => true,
  39. 'phpdoc_trim' => true,
  40. 'phpdoc_types' => true,
  41. 'phpdoc_var_without_name' => true,
  42. 'self_accessor' => true,
  43. 'single_quote' => true,
  44. 'space_after_semicolon' => true,
  45. 'standardize_not_equals' => true,
  46. 'ternary_operator_spaces' => true,
  47. 'trailing_comma_in_multiline_array' => true,
  48. 'trim_array_spaces' => true,
  49. 'unary_operator_spaces' => true,
  50. ];
  51. return Config::create()->setRules($rules)
  52. ->setFinder(Finder::create()->in(__DIR__))
  53. ->setUsingCache(true)
  54. ->setRiskyAllowed(true);