- composer g require symplify/easy-coding-standard
- put config
ecs.php
in your project dir - run
ecs
Last active
June 27, 2023 10:29
-
-
Save fizzka/911104b094f6f7432cbc08dd5c34133c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
declare(strict_types=1); | |
use PhpCsFixer\Fixer\Strict\DeclareStrictTypesFixer; | |
use PhpCsFixer\Fixer\Import\NoUnusedImportsFixer; | |
use PhpCsFixer\Fixer\Import\OrderedImportsFixer; | |
use Symplify\EasyCodingStandard\Config\ECSConfig; | |
use Symplify\EasyCodingStandard\ValueObject\Set\SetList; | |
return function (ECSConfig $ecsConfig): void { | |
$ecsConfig->paths([ | |
__DIR__ . '/src', | |
__DIR__ . '/tests', | |
]); | |
// $ecsConfig->indentation('tab'); | |
// this way you add a single rule | |
$ecsConfig->rules([ | |
OrderedImportsFixer::class, | |
DeclareStrictTypesFixer::class, | |
NoUnusedImportsFixer::class, | |
]); | |
$ecsConfig->skip([ | |
]); | |
// this way you can add sets - group of rules | |
$ecsConfig->sets([ | |
// SetList::SPACES, | |
SetList::ARRAY, | |
SetList::NAMESPACES, | |
SetList::PSR_12, | |
]); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment