|
| 1 | +<?php |
| 2 | + |
| 3 | +declare(strict_types=1); |
| 4 | + |
| 5 | +namespace VisualCraft\PhpCsFixerConfig\RuleSet; |
| 6 | + |
| 7 | +use VisualCraft\PhpCsFixerConfig\RuleSetInterface; |
| 8 | + |
| 9 | +final class Php82 implements RuleSetInterface |
| 10 | +{ |
| 11 | + public function name(): string |
| 12 | + { |
| 13 | + return 'Visual Craft (PHP 8.2)'; |
| 14 | + } |
| 15 | + |
| 16 | + public function rules(): array |
| 17 | + { |
| 18 | + return [ |
| 19 | + '@Symfony' => true, |
| 20 | + '@Symfony:risky' => true, |
| 21 | + '@PHP82Migration' => true, |
| 22 | + '@PHP80Migration:risky' => true, |
| 23 | + '@PhpCsFixer' => true, |
| 24 | + '@PhpCsFixer:risky' => true, |
| 25 | + '@DoctrineAnnotation' => true, |
| 26 | + 'doctrine_annotation_braces' => false, |
| 27 | + '@PHPUnit100Migration:risky' => true, |
| 28 | + 'php_unit_test_class_requires_covers' => false, |
| 29 | + 'php_unit_test_case_static_method_calls' => ['call_type' => 'this'], |
| 30 | + 'array_syntax' => [ |
| 31 | + 'syntax' => 'short', |
| 32 | + ], |
| 33 | + 'class_attributes_separation' => ['elements' => ['method' => 'one', 'property' => 'one']], |
| 34 | + 'concat_space' => ['spacing' => 'one'], |
| 35 | + 'phpdoc_align' => false, |
| 36 | + 'phpdoc_separation' => false, |
| 37 | + 'phpdoc_to_comment' => false, |
| 38 | + 'phpdoc_add_missing_param_annotation' => false, |
| 39 | + 'phpdoc_types_order' => [ |
| 40 | + 'null_adjustment' => 'always_last', |
| 41 | + ], |
| 42 | + 'increment_style' => false, |
| 43 | + 'yoda_style' => ['equal' => false, 'identical' => false, 'less_and_greater' => false], |
| 44 | + 'fopen_flags' => false, |
| 45 | + 'return_assignment' => false, |
| 46 | + 'final_internal_class' => false, |
| 47 | + 'blank_line_before_statement' => [ |
| 48 | + 'statements' => [ |
| 49 | + 'break', |
| 50 | + 'case', |
| 51 | + 'continue', |
| 52 | + 'declare', |
| 53 | + 'default', |
| 54 | + 'do', |
| 55 | + 'exit', |
| 56 | + 'for', |
| 57 | + 'foreach', |
| 58 | + 'goto', |
| 59 | + 'if', |
| 60 | + 'include', |
| 61 | + 'include_once', |
| 62 | + 'require', |
| 63 | + 'require_once', |
| 64 | + 'return', |
| 65 | + 'switch', |
| 66 | + 'throw', |
| 67 | + 'try', |
| 68 | + 'while', |
| 69 | + ], |
| 70 | + ], |
| 71 | + \PhpCsFixerCustomFixers\Fixer\CommentSurroundedBySpacesFixer::name() => true, |
| 72 | + \PhpCsFixerCustomFixers\Fixer\MultilineCommentOpeningClosingAloneFixer::name() => true, |
| 73 | + \PhpCsFixerCustomFixers\Fixer\NoDoctrineMigrationsGeneratedCommentFixer::name() => true, |
| 74 | + \PhpCsFixerCustomFixers\Fixer\NoDuplicatedImportsFixer::name() => true, |
| 75 | + \PhpCsFixerCustomFixers\Fixer\NoImportFromGlobalNamespaceFixer::name() => true, |
| 76 | + \PhpCsFixerCustomFixers\Fixer\NoLeadingSlashInGlobalNamespaceFixer::name() => true, |
| 77 | + \PhpCsFixerCustomFixers\Fixer\NoNullableBooleanTypeFixer::name() => true, |
| 78 | + \PhpCsFixerCustomFixers\Fixer\NoPhpStormGeneratedCommentFixer::name() => true, |
| 79 | + \PhpCsFixerCustomFixers\Fixer\NoSuperfluousConcatenationFixer::name() => true, |
| 80 | + \PhpCsFixerCustomFixers\Fixer\NoUselessCommentFixer::name() => true, |
| 81 | + \PhpCsFixerCustomFixers\Fixer\NoUselessDirnameCallFixer::name() => true, |
| 82 | + \PhpCsFixerCustomFixers\Fixer\NoUselessDoctrineRepositoryCommentFixer::name() => true, |
| 83 | + \PhpCsFixerCustomFixers\Fixer\NoUselessParenthesisFixer::name() => true, |
| 84 | + \PhpCsFixerCustomFixers\Fixer\NoUselessStrlenFixer::name() => true, |
| 85 | + \PhpCsFixerCustomFixers\Fixer\PhpUnitAssertArgumentsOrderFixer::name() => true, |
| 86 | + \PhpCsFixerCustomFixers\Fixer\PhpUnitDedicatedAssertFixer::name() => true, |
| 87 | + \PhpCsFixerCustomFixers\Fixer\PhpUnitNoUselessReturnFixer::name() => true, |
| 88 | + \PhpCsFixerCustomFixers\Fixer\PhpdocNoSuperfluousParamFixer::name() => true, |
| 89 | + \PhpCsFixerCustomFixers\Fixer\PhpdocTypesTrimFixer::name() => true, |
| 90 | + \PhpCsFixerCustomFixers\Fixer\SingleSpaceAfterStatementFixer::name() => true, |
| 91 | + \PhpCsFixerCustomFixers\Fixer\SingleSpaceBeforeStatementFixer::name() => true, |
| 92 | + \PhpCsFixerCustomFixers\Fixer\StringableInterfaceFixer::name() => true, |
| 93 | + 'PedroTroller/ordered_with_getter_and_setter_first' => true, |
| 94 | + 'PedroTroller/line_break_between_method_arguments' => [ |
| 95 | + 'max-args' => false, |
| 96 | + 'max-length' => 120, |
| 97 | + 'automatic-argument-merge' => true, |
| 98 | + ], |
| 99 | + 'PedroTroller/line_break_between_statements' => true, |
| 100 | + ]; |
| 101 | + } |
| 102 | + |
| 103 | + public function getCustomFixers(): iterable |
| 104 | + { |
| 105 | + yield from new \PhpCsFixerCustomFixers\Fixers(); |
| 106 | + yield from new \PedroTroller\CS\Fixer\Fixers(); |
| 107 | + } |
| 108 | + |
| 109 | + public function getRiskyAllowed(): bool |
| 110 | + { |
| 111 | + return true; |
| 112 | + } |
| 113 | +} |
0 commit comments