|
2 | 2 |
|
3 | 3 | declare(strict_types=1);
|
4 | 4 |
|
5 |
| -use PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer; |
6 |
| -use PhpCsFixer\Fixer\ArrayNotation\TrimArraySpacesFixer; |
7 |
| -use PhpCsFixer\Fixer\Basic\SingleLineEmptyBodyFixer; |
8 |
| -use PhpCsFixer\Fixer\Casing\ClassReferenceNameCasingFixer; |
9 |
| -use PhpCsFixer\Fixer\Casing\LowercaseStaticReferenceFixer; |
10 |
| -use PhpCsFixer\Fixer\Casing\MagicMethodCasingFixer; |
11 |
| -use PhpCsFixer\Fixer\Casing\NativeFunctionCasingFixer; |
12 |
| -use PhpCsFixer\Fixer\Casing\NativeFunctionTypeDeclarationCasingFixer; |
13 |
| -use PhpCsFixer\Fixer\CastNotation\CastSpacesFixer; |
| 5 | +use Codelytv\CodingStyle\CodelyRules; |
14 | 6 | use PhpCsFixer\Fixer\ClassNotation\FinalClassFixer;
|
15 |
| -use PhpCsFixer\Fixer\ClassNotation\FinalPublicMethodForAbstractClassFixer; |
16 |
| -use PhpCsFixer\Fixer\ClassNotation\NoBlankLinesAfterClassOpeningFixer; |
17 |
| -use PhpCsFixer\Fixer\ClassNotation\NoNullPropertyInitializationFixer; |
18 |
| -use PhpCsFixer\Fixer\ClassNotation\NoUnneededFinalMethodFixer; |
19 |
| -use PhpCsFixer\Fixer\ClassNotation\OrderedTypesFixer; |
20 |
| -use PhpCsFixer\Fixer\ClassNotation\ProtectedToPrivateFixer; |
21 |
| -use PhpCsFixer\Fixer\ClassNotation\SelfAccessorFixer; |
22 |
| -use PhpCsFixer\Fixer\ClassNotation\SelfStaticAccessorFixer; |
23 |
| -use PhpCsFixer\Fixer\ClassNotation\VisibilityRequiredFixer; |
24 |
| -use PhpCsFixer\Fixer\ClassUsage\DateTimeImmutableFixer; |
25 |
| -use PhpCsFixer\Fixer\ControlStructure\NoUnneededControlParenthesesFixer; |
26 |
| -use PhpCsFixer\Fixer\ControlStructure\NoUnneededCurlyBracesFixer; |
27 |
| -use PhpCsFixer\Fixer\ControlStructure\NoUselessElseFixer; |
28 |
| -use PhpCsFixer\Fixer\ControlStructure\SimplifiedIfReturnFixer; |
29 |
| -use PhpCsFixer\Fixer\ControlStructure\TrailingCommaInMultilineFixer; |
30 |
| -use PhpCsFixer\Fixer\ControlStructure\YodaStyleFixer; |
31 |
| -use PhpCsFixer\Fixer\Import\FullyQualifiedStrictTypesFixer; |
32 |
| -use PhpCsFixer\Fixer\Import\GlobalNamespaceImportFixer; |
33 |
| -use PhpCsFixer\Fixer\Import\NoLeadingImportSlashFixer; |
34 |
| -use PhpCsFixer\Fixer\Import\NoUnusedImportsFixer; |
35 |
| -use PhpCsFixer\Fixer\Operator\AssignNullCoalescingToCoalesceEqualFixer; |
36 |
| -use PhpCsFixer\Fixer\Operator\NoUselessConcatOperatorFixer; |
37 |
| -use PhpCsFixer\Fixer\Operator\NoUselessNullsafeOperatorFixer; |
38 |
| -use PhpCsFixer\Fixer\Operator\ObjectOperatorWithoutWhitespaceFixer; |
39 |
| -use PhpCsFixer\Fixer\Operator\TernaryToElvisOperatorFixer; |
40 |
| -use PhpCsFixer\Fixer\Operator\TernaryToNullCoalescingFixer; |
41 |
| -use PhpCsFixer\Fixer\PhpUnit\PhpUnitConstructFixer; |
42 |
| -use PhpCsFixer\Fixer\PhpUnit\PhpUnitDedicateAssertFixer; |
43 |
| -use PhpCsFixer\Fixer\PhpUnit\PhpUnitDedicateAssertInternalTypeFixer; |
44 |
| -use PhpCsFixer\Fixer\PhpUnit\PhpUnitExpectationFixer; |
45 |
| -use PhpCsFixer\Fixer\PhpUnit\PhpUnitMethodCasingFixer; |
46 |
| -use PhpCsFixer\Fixer\Strict\DeclareStrictTypesFixer; |
47 |
| -use PhpCsFixer\Fixer\Strict\StrictComparisonFixer; |
48 |
| -use PhpCsFixer\Fixer\StringNotation\SingleQuoteFixer; |
49 |
| -use PhpCsFixer\Fixer\Whitespace\StatementIndentationFixer; |
50 |
| -use PhpCsFixer\Fixer\Whitespace\TypeDeclarationSpacesFixer; |
51 |
| -use PhpCsFixer\Fixer\Whitespace\TypesSpacesFixer; |
52 |
| -use Symplify\CodingStandard\Fixer\LineLength\LineLengthFixer; |
53 |
| -use Symplify\CodingStandard\Fixer\Strict\BlankLineAfterStrictTypesFixer; |
54 | 7 | use Symplify\EasyCodingStandard\Config\ECSConfig;
|
55 |
| -use Symplify\EasyCodingStandard\ValueObject\Set\SetList; |
56 | 8 |
|
57 | 9 | return function (ECSConfig $ecsConfig): void {
|
58 | 10 | $ecsConfig->paths([
|
|
61 | 13 | __DIR__ . '/tests',
|
62 | 14 | ]);
|
63 | 15 |
|
64 |
| - $ecsConfig->sets([SetList::PSR_12]); |
65 |
| - |
66 |
| - $ecsConfig->rules([ |
67 |
| - // Imports |
68 |
| - NoUnusedImportsFixer::class, |
69 |
| - FullyQualifiedStrictTypesFixer::class, |
70 |
| - GlobalNamespaceImportFixer::class, |
71 |
| - NoLeadingImportSlashFixer::class, |
72 |
| - // Arrays |
73 |
| - TrimArraySpacesFixer::class, |
74 |
| - // Blank lines |
75 |
| - BlankLineAfterStrictTypesFixer::class, |
76 |
| - NoBlankLinesAfterClassOpeningFixer::class, |
77 |
| - // Spacing |
78 |
| - SingleLineEmptyBodyFixer::class, |
79 |
| - CastSpacesFixer::class, |
80 |
| - TypeDeclarationSpacesFixer::class, |
81 |
| - TypesSpacesFixer::class, |
82 |
| - // Casing |
83 |
| - ClassReferenceNameCasingFixer::class, |
84 |
| - LowercaseStaticReferenceFixer::class, |
85 |
| - MagicMethodCasingFixer::class, |
86 |
| - NativeFunctionCasingFixer::class, |
87 |
| - NativeFunctionTypeDeclarationCasingFixer::class, |
88 |
| - // Architecture |
89 |
| - FinalClassFixer::class, |
90 |
| - FinalPublicMethodForAbstractClassFixer::class, |
91 |
| - ProtectedToPrivateFixer::class, |
92 |
| - VisibilityRequiredFixer::class, |
93 |
| - DateTimeImmutableFixer::class, |
94 |
| - NoUselessElseFixer::class, |
95 |
| - // Operator |
96 |
| - AssignNullCoalescingToCoalesceEqualFixer::class, |
97 |
| - NoUselessConcatOperatorFixer::class, |
98 |
| - NoUselessNullsafeOperatorFixer::class, |
99 |
| - ObjectOperatorWithoutWhitespaceFixer::class, |
100 |
| - TernaryToElvisOperatorFixer::class, |
101 |
| - TernaryToNullCoalescingFixer::class, |
102 |
| - // Testing |
103 |
| - PhpUnitConstructFixer::class, |
104 |
| - PhpUnitDedicateAssertFixer::class, |
105 |
| - PhpUnitDedicateAssertInternalTypeFixer::class, |
106 |
| - PhpUnitExpectationFixer::class, |
107 |
| - // Other |
108 |
| - LineLengthFixer::class, |
109 |
| - NoNullPropertyInitializationFixer::class, |
110 |
| - NoUnneededFinalMethodFixer::class, |
111 |
| - SelfAccessorFixer::class, |
112 |
| - SelfStaticAccessorFixer::class, |
113 |
| - NoUnneededControlParenthesesFixer::class, |
114 |
| - NoUnneededCurlyBracesFixer::class, |
115 |
| - SimplifiedIfReturnFixer::class, |
116 |
| - TrailingCommaInMultilineFixer::class, |
117 |
| - DeclareStrictTypesFixer::class, |
118 |
| - StrictComparisonFixer::class, |
119 |
| - SingleQuoteFixer::class, |
120 |
| - StatementIndentationFixer::class, |
121 |
| - ]); |
122 |
| - |
123 |
| - $ecsConfig->ruleWithConfiguration(ArraySyntaxFixer::class, ['syntax' => 'short']); |
124 |
| - $ecsConfig->ruleWithConfiguration(LineLengthFixer::class, [LineLengthFixer::LINE_LENGTH => 120]); |
125 |
| - $ecsConfig->ruleWithConfiguration(YodaStyleFixer::class, ['equal' => false, 'identical' => false, 'less_and_greater' => false]); |
126 |
| - $ecsConfig->ruleWithConfiguration(PhpUnitMethodCasingFixer::class, ['case' => PhpUnitMethodCasingFixer::SNAKE_CASE]); |
127 |
| - $ecsConfig->ruleWithConfiguration(OrderedTypesFixer::class, ['null_adjustment' => 'always_last']); |
| 16 | + $ecsConfig->sets([CodelyRules::CODING_STYLE]); |
128 | 17 |
|
129 | 18 | $ecsConfig->skip([
|
130 | 19 | FinalClassFixer::class => [
|
|
0 commit comments