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