Skip to content

Commit 2c34ae8

Browse files
authored
Merge pull request #115 from szepeviktor/setlist
Add setlist
2 parents 353ab63 + 2388f36 commit 2c34ae8

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,15 @@ composer require --dev lmc/coding-standard
2222
```php
2323
<?php declare(strict_types=1);
2424

25+
use Lmc\CodingStandard\Set\SetList;
2526
use Symplify\EasyCodingStandard\Config\ECSConfig;
2627

2728
return ECSConfig::configure()
2829
->withPaths([__DIR__ . '/src', __DIR__ . '/tests']) // optionally add 'config' or other directories with PHP files
2930
->withRootFiles() // to also check ecs.php and all other php files in the root directory
3031
->withSets(
3132
[
32-
__DIR__ . '/vendor/lmc/coding-standard/ecs.php',
33+
SetList::ALMACAREER,
3334
]
3435
);
3536
```
@@ -67,6 +68,7 @@ Below find examples of some more opinionated checks you may want to add dependin
6768
```php
6869
<?php declare(strict_types=1);
6970

71+
use Lmc\CodingStandard\Set\SetList;
7072
use PHP_CodeSniffer\Standards\Generic\Sniffs\Files\LineLengthSniff;
7173
use PhpCsFixer\Fixer\PhpUnit\PhpUnitTestAnnotationFixer;
7274
use Symplify\EasyCodingStandard\Config\ECSConfig;
@@ -75,7 +77,7 @@ return ECSConfig::configure()
7577
/* (...) */
7678
->withSets(
7779
[
78-
__DIR__ . '/vendor/lmc/coding-standard/ecs.php',
80+
SetList::ALMACAREER,
7981
]
8082
)
8183
->withRules(

ecs-internal.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?php declare(strict_types=1);
22

3+
use Lmc\CodingStandard\Set\SetList;
34
use PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\ForbiddenFunctionsSniff;
45
use PhpCsFixer\Fixer\ClassNotation\ClassAttributesSeparationFixer;
56
use PhpCsFixer\Fixer\PhpUnit\PhpUnitTestAnnotationFixer;
@@ -14,7 +15,7 @@
1415
->withRootFiles()
1516
->withSets(
1617
[
17-
__DIR__ . '/ecs.php',
18+
SetList::ALMACAREER,
1819
],
1920
)
2021
->withConfiguredRule(PhpUnitTestAnnotationFixer::class, ['style' => 'annotation'])

src/Set/SetList.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php declare(strict_types=1);
2+
3+
namespace Lmc\CodingStandard\Set;
4+
5+
class SetList
6+
{
7+
/**
8+
* @var string
9+
*/
10+
public const ALMACAREER = __DIR__ . '/../../ecs.php';
11+
}

0 commit comments

Comments
 (0)