Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@ composer require --dev lmc/coding-standard
```php
<?php declare(strict_types=1);

use Lmc\CodingStandard\Set\SetList;
use Symplify\EasyCodingStandard\Config\ECSConfig;

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

use Lmc\CodingStandard\Set\SetList;
use PHP_CodeSniffer\Standards\Generic\Sniffs\Files\LineLengthSniff;
use PhpCsFixer\Fixer\PhpUnit\PhpUnitTestAnnotationFixer;
use Symplify\EasyCodingStandard\Config\ECSConfig;
Expand All @@ -75,7 +77,7 @@ return ECSConfig::configure()
/* (...) */
->withSets(
[
__DIR__ . '/vendor/lmc/coding-standard/ecs.php',
SetList::ALMACAREER,
]
)
->withRules(
Expand Down
3 changes: 2 additions & 1 deletion ecs-internal.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php declare(strict_types=1);

use Lmc\CodingStandard\Set\SetList;
use PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\ForbiddenFunctionsSniff;
use PhpCsFixer\Fixer\ClassNotation\ClassAttributesSeparationFixer;
use PhpCsFixer\Fixer\PhpUnit\PhpUnitTestAnnotationFixer;
Expand All @@ -14,7 +15,7 @@
->withRootFiles()
->withSets(
[
__DIR__ . '/ecs.php',
SetList::ALMACAREER,
],
)
->withConfiguredRule(PhpUnitTestAnnotationFixer::class, ['style' => 'annotation'])
Expand Down
11 changes: 11 additions & 0 deletions src/Set/SetList.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php declare(strict_types=1);

namespace Lmc\CodingStandard\Set;

class SetList
{
/**
* @var string
*/
public const ALMACAREER = __DIR__ . '/../../ecs.php';
}