|
3 | 3 | $finder = (new PhpCsFixer\Finder()) |
4 | 4 | ->in(__DIR__) |
5 | 5 | ->exclude('var') |
6 | | -; |
| 6 | + ->exclude('vendor') |
| 7 | + ->exclude('migrations'); |
7 | 8 |
|
8 | | -return (new PhpCsFixer\Config()) |
| 9 | +$config = (new PhpCsFixer\Config()) |
9 | 10 | ->setRules([ |
10 | | - '@Symfony' => true, |
| 11 | + '@PSR12' => true, |
| 12 | + // コーディングスタイルの統一 |
| 13 | + 'single_quote' => true, |
| 14 | + 'array_syntax' => ['syntax' => 'short'], |
| 15 | + 'concat_space' => ['spacing' => 'one'], |
| 16 | + // Formatting only, let Rector handle all import logic |
| 17 | + 'blank_line_after_opening_tag' => false, |
| 18 | + 'linebreak_after_opening_tag' => false, |
| 19 | + // PHPDoc設定 |
| 20 | + 'phpdoc_order' => true, |
| 21 | + 'phpdoc_separation' => true, |
| 22 | + 'phpdoc_single_line_var_spacing' => true, |
| 23 | + // クラス属性の分離 |
| 24 | + 'class_attributes_separation' => [ |
| 25 | + 'elements' => [ |
| 26 | + 'method' => 'one', |
| 27 | + 'property' => 'one', |
| 28 | + ], |
| 29 | + ], |
| 30 | + // Basic formatting rules |
| 31 | + 'indentation_type' => true, |
| 32 | + 'line_ending' => true, |
| 33 | + 'lowercase_keywords' => true, |
| 34 | + 'method_argument_space' => true, |
| 35 | + 'no_closing_tag' => true, |
| 36 | + 'no_spaces_after_function_name' => true, |
| 37 | + 'no_spaces_inside_parenthesis' => true, |
| 38 | + 'no_trailing_whitespace' => true, |
| 39 | + 'no_trailing_whitespace_in_comment' => true, |
| 40 | + 'single_blank_line_at_eof' => true, |
| 41 | + 'single_class_element_per_statement' => true, |
| 42 | + 'single_import_per_statement' => true, |
| 43 | + 'single_line_after_imports' => true, |
| 44 | + 'visibility_required' => true, |
| 45 | + 'encoding' => true, |
| 46 | + 'full_opening_tag' => true, |
11 | 47 | ]) |
12 | | - ->setFinder($finder) |
13 | | -; |
| 48 | + ->setRiskyAllowed(true) |
| 49 | + ->setFinder($finder); |
| 50 | + |
| 51 | +return $config; |
0 commit comments