|
| 1 | +<?php |
| 2 | + |
| 3 | +$header = <<<'EOF' |
| 4 | +This file is part of MoChat. |
| 5 | +@link https://mo.chat |
| 6 | +@document https://mochat.wiki |
| 7 | +@contact group@mo.chat |
| 8 | +@license https://github.com/mochat-cloud/mochat/blob/master/LICENSE |
| 9 | +EOF; |
| 10 | + |
| 11 | +return PhpCsFixer\Config::create() |
| 12 | + ->setRiskyAllowed(true) |
| 13 | + ->setRules([ |
| 14 | + '@PSR2' => true, |
| 15 | + '@Symfony' => true, |
| 16 | + '@DoctrineAnnotation' => true, |
| 17 | + '@PhpCsFixer' => true, |
| 18 | + 'header_comment' => [ |
| 19 | + 'commentType' => 'PHPDoc', |
| 20 | + 'header' => $header, |
| 21 | + 'separate' => 'none', |
| 22 | + 'location' => 'after_declare_strict', |
| 23 | + ], |
| 24 | + 'array_syntax' => [ |
| 25 | + 'syntax' => 'short', |
| 26 | + ], |
| 27 | + 'list_syntax' => [ |
| 28 | + 'syntax' => 'short', |
| 29 | + ], |
| 30 | + 'concat_space' => [ |
| 31 | + 'spacing' => 'one', |
| 32 | + ], |
| 33 | + 'blank_line_before_statement' => [ |
| 34 | + 'statements' => [ |
| 35 | + 'declare', |
| 36 | + ], |
| 37 | + ], |
| 38 | + 'general_phpdoc_annotation_remove' => [ |
| 39 | + 'annotations' => [ |
| 40 | + 'describe' |
| 41 | + ], |
| 42 | + ], |
| 43 | + 'ordered_imports' => [ |
| 44 | + 'imports_order' => [ |
| 45 | + 'class', 'function', 'const', |
| 46 | + ], |
| 47 | + 'sort_algorithm' => 'alpha', |
| 48 | + ], |
| 49 | + 'single_line_comment_style' => [ |
| 50 | + 'comment_types' => [ |
| 51 | + ], |
| 52 | + ], |
| 53 | + 'yoda_style' => [ |
| 54 | + 'always_move_variable' => false, |
| 55 | + 'equal' => false, |
| 56 | + 'identical' => false, |
| 57 | + ], |
| 58 | + 'phpdoc_align' => [ |
| 59 | + 'align' => 'left', |
| 60 | + ], |
| 61 | + 'multiline_whitespace_before_semicolons' => [ |
| 62 | + 'strategy' => 'no_multi_line', |
| 63 | + ], |
| 64 | + 'class_attributes_separation' => true, |
| 65 | + 'combine_consecutive_unsets' => true, |
| 66 | + 'declare_strict_types' => true, |
| 67 | + 'linebreak_after_opening_tag' => true, |
| 68 | + 'lowercase_constants' => true, |
| 69 | + 'lowercase_static_reference' => true, |
| 70 | + 'no_useless_else' => true, |
| 71 | + 'no_unused_imports' => true, |
| 72 | + 'not_operator_with_successor_space' => true, |
| 73 | + 'not_operator_with_space' => false, |
| 74 | + 'ordered_class_elements' => true, |
| 75 | + 'php_unit_strict' => false, |
| 76 | + 'phpdoc_separation' => false, |
| 77 | + 'single_quote' => true, |
| 78 | + 'standardize_not_equals' => true, |
| 79 | + 'multiline_comment_opening_closing' => true, |
| 80 | + 'binary_operator_spaces' => [ |
| 81 | + 'operators' => [ |
| 82 | + '=' => 'align_single_space_minimal', |
| 83 | + '=>' => 'align_single_space_minimal', |
| 84 | + ], |
| 85 | + ] |
| 86 | + ]) |
| 87 | + ->setFinder( |
| 88 | + PhpCsFixer\Finder::create() |
| 89 | + ->exclude('vendor') |
| 90 | + ->exclude('runtime') |
| 91 | + ->exclude('storage/apidoc') |
| 92 | + ->in(__DIR__) |
| 93 | + ) |
| 94 | + ->setUsingCache(false); |
0 commit comments