Skip to content

Commit 9178d43

Browse files
committed
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

+3-3
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

+7-1
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

+2-2
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

-11
This file was deleted.

src/CodingStyle.php

+11
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)