diff --git a/README.md b/README.md index 9095cee..f6454ae 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,26 @@ imports: - { resource: vendor/umbrellio/code-style-php/umbrellio-cs.yml } ``` +If major version of [EasyCodingStandard](https://github.com/Symplify/EasyCodingStandard) 9 or higher +create config `ecs.php`: + +```php +parameters(); + + $parameters->set(Option::SETS, [ + 'vendor/umbrellio/code-style-php/umbrellio-cs.php' + ]); +}; +``` + --- ### Usage @@ -29,6 +49,12 @@ Run in CLI: vendor/bin/ecs check src --fix --config=ecs.yml ``` +or: + +``` +vendor/bin/ecs check src --fix --config=ecs.php +``` + ### Dependencies (and Links) - [EasyCodingStandard](https://github.com/Symplify/EasyCodingStandard) - used library. diff --git a/umbrellio-cs.php b/umbrellio-cs.php new file mode 100644 index 0000000..e66cdec --- /dev/null +++ b/umbrellio-cs.php @@ -0,0 +1,47 @@ +parameters(); + $services = $containerConfigurator->services(); + + $parameters->set(Option::SETS, [ + SetList::CLEAN_CODE, + SetList::PSR_12, + SetList::COMMON, + SetList::SYMPLIFY, + ]); + + $services->set(DeclareStrictTypesFixer::class); + $services->set('SlevomatCodingStandard\Sniffs\Namespaces\ReferenceUsedNamesOnlySniff') + ->property('allowPartialUses', true); + + $parameters->set('skip', [ + NotOperatorWithSuccessorSpaceFixer::class => null, + 'Symplify\CodingStandard\Sniffs\Naming\TraitNameSniff' => null, + 'Symplify\CodingStandard\Sniffs\Naming\InterfaceNameSniff' => null, + 'Symplify\CodingStandard\Sniffs\Naming\ClassNameSuffixByParentSniff' => null, + 'Symplify\CodingStandard\Sniffs\Naming\AbstractClassNameSniff' => null, + 'Symplify\CodingStandard\Sniffs\Commenting\VarConstantCommentSniff' => null, + 'Symplify\CodingStandard\Fixer\Commenting\BlockPropertyCommentFixer' => null, + 'Symplify\CodingStandard\Fixer\Naming\PropertyNameMatchingTypeFixer' => null, + 'Symplify\CodingStandard\Fixer\Import\ImportNamespacedNameFixer' => null, + 'SlamCsFixer\FinalInternalClassFixer' => null, + 'Symplify\CodingStandard\Sniffs\CleanCode\ForbiddenStaticFunctionSniff' => null, + 'Symplify\CodingStandard\Sniffs\DependencyInjection\NoClassInstantiationSniff' => null, + 'Symplify\CodingStandard\Sniffs\Architecture\ExplicitExceptionSniff' => null, + 'SlevomatCodingStandard\Sniffs\Classes\UnusedPrivateElementsSniff' => null, + AssignmentInConditionSniff::class => null, + 'SlevomatCodingStandard\Sniffs\Classes\TraitUseDeclarationSniff' => null, + ClassAttributesSeparationFixer::class => null + ]); +};