-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add php config for ecs version >9 (#3)
Co-authored-by: Evgen <[email protected]>
- Loading branch information
1 parent
8360392
commit ddad9a5
Showing
2 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis\AssignmentInConditionSniff; | ||
use PhpCsFixer\Fixer\ClassNotation\ClassAttributesSeparationFixer; | ||
use PhpCsFixer\Fixer\Operator\NotOperatorWithSuccessorSpaceFixer; | ||
use PhpCsFixer\Fixer\Strict\DeclareStrictTypesFixer; | ||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; | ||
use Symplify\EasyCodingStandard\ValueObject\Option; | ||
use Symplify\EasyCodingStandard\ValueObject\Set\SetList; | ||
|
||
return static function(ContainerConfigurator $containerConfigurator): void { | ||
$parameters = $containerConfigurator->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 | ||
]); | ||
}; |