Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 34e9050

Browse files
feat: add coding style aligned
1 parent 2d350ba commit 34e9050

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

‎README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@
3636
$ecsConfig->paths([__DIR__ . '/src',]);
3737
3838
$ecsConfig->sets([CodelyRules::CODING_STYLE]);
39+
40+
// Or this if you prefer to have the code aligned
41+
// $ecsConfig->sets([CodelyRules::CODING_STYLE_ALIGNED]);
3942
};
4043
```
4144
3. Execute it:

‎src/CodelyRules.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@
77
final class CodelyRules
88
{
99
public const CODING_STYLE = __DIR__ . '/coding_style.php';
10+
public const CODING_STYLE_ALIGNED = __DIR__ . '/coding_style_aligned.php';
1011
}

‎src/coding_style_aligned.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+
};

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /