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 9178d43

Browse files
feat: simplify api
1 parent 34e9050 commit 9178d43

File tree

5 files changed

+23
-17
lines changed

5 files changed

+23
-17
lines changed

‎README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,16 @@
2929
```
3030
2. Add it to your `ecs.php` file:
3131
```php
32-
use CodelyTv\CodingStyle\CodelyRules;
32+
use CodelyTv\CodingStyle;
3333
use Symplify\EasyCodingStandard\Config\ECSConfig;
3434
3535
return function (ECSConfig $ecsConfig): void {
3636
$ecsConfig->paths([__DIR__ . '/src',]);
3737
38-
$ecsConfig->sets([CodelyRules::CODING_STYLE]);
38+
$ecsConfig->sets([CodingStyle::DEFAULT]);
3939
4040
// Or this if you prefer to have the code aligned
41-
// $ecsConfig->sets([CodelyRules::CODING_STYLE_ALIGNED]);
41+
// $ecsConfig->sets([CodingStyle::ALIGNED]);
4242
};
4343
```
4444
3. Execute it:

‎composer.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,15 @@
44
"type": "library",
55
"keywords": ["static analysis", "code style"],
66
"license": "AGPL-3.0-or-later",
7+
"authors": [
8+
{
9+
"name": "Codely",
10+
"homepage": "https://codely.com"
11+
}
12+
],
713
"autoload": {
814
"psr-4": {
9-
"CodelyTv\\CodingStyle\\": "src/"
15+
"CodelyTv\\": "src/"
1016
}
1117
},
1218
"require": {

‎ecs.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
declare(strict_types=1);
44

5-
use CodelyTv\CodingStyle\CodelyRules;
5+
use CodelyTv\CodingStyle;
66
use Symplify\EasyCodingStandard\Config\ECSConfig;
77

88
return function (ECSConfig $ecsConfig): void {
99
$ecsConfig->paths([__DIR__ . '/src',]);
1010

11-
$ecsConfig->sets([CodelyRules::CODING_STYLE]);
11+
$ecsConfig->sets([CodingStyle::DEFAULT]);
1212
};

‎src/CodelyRules.php

Lines changed: 0 additions & 11 deletions
This file was deleted.

‎src/CodingStyle.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace CodelyTv;
6+
7+
final class CodingStyle
8+
{
9+
public const DEFAULT = __DIR__ . '/coding_style.php';
10+
public const ALIGNED = __DIR__ . '/coding_style_aligned.php';
11+
}

0 commit comments

Comments
(0)

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