File tree 3 files changed +25
-0
lines changed
3 files changed +25
-0
lines changed Original file line number Diff line number Diff line change 36
36
$ecsConfig -> paths([__DIR__ . ' /src' ,]);
37
37
38
38
$ecsConfig -> sets([CodelyRules::CODING_STYLE]);
39
+
40
+ // Or this if you prefer to have the code aligned
41
+ // $ecsConfig -> sets([CodelyRules::CODING_STYLE_ALIGNED]);
39
42
};
40
43
` ` `
41
44
3. Execute it:
Original file line number Diff line number Diff line change 7
7
final class CodelyRules
8
8
{
9
9
public const CODING_STYLE = __DIR__ . '/coding_style.php ' ;
10
+ public const CODING_STYLE_ALIGNED = __DIR__ . '/coding_style_aligned.php ' ;
10
11
}
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ declare (strict_types=1 );
4
+
5
+ use PhpCsFixer \Fixer \Operator \BinaryOperatorSpacesFixer ;
6
+ use Symplify \EasyCodingStandard \Config \ECSConfig ;
7
+
8
+ return static function (ECSConfig $ ecsConfig ): void {
9
+ $ ecsConfig ->ruleWithConfiguration (
10
+ BinaryOperatorSpacesFixer::class,
11
+ [
12
+ 'operators ' =>
13
+ [
14
+ '= ' => 'align ' ,
15
+ '=> ' => 'align ' ,
16
+ ],
17
+ ]
18
+ );
19
+
20
+ $ ecsConfig ->sets ([__DIR__ . '/coding_style.php ' ]);
21
+ };
You can’t perform that action at this time.
0 commit comments