diff --git a/bin/rule-set-generator b/bin/rule-set-generator index 5b67b54..c4ecfc8 100755 --- a/bin/rule-set-generator +++ b/bin/rule-set-generator @@ -5,8 +5,7 @@ use PhpParser\BuilderFactory; use Zing\CodingStandard\PHPCodeSnifferRuleSetGenerator; use Zing\CodingStandard\PhpCsFixerRuleSetGenerator; use Zing\CodingStandard\Printer; -use Zing\CodingStandard\Printers\PHPCodeSnifferRuleSetPrinter; -use Zing\CodingStandard\Printers\PhpCsFixerRuleSetPrinter; +use Zing\CodingStandard\Printers\RuleSetPrinter; if (is_file(__DIR__ . '/../vendor/autoload.php') === true) { include_once __DIR__ . '/../vendor/autoload.php'; @@ -23,8 +22,8 @@ $printer = new Printer([ 'shortArraySyntax' => true, ]); $generators = [ - new PhpCsFixerRuleSetGenerator(new PhpCsFixerRuleSetPrinter($builderFactory,$printer)), - new PHPCodeSnifferRuleSetGenerator(new PHPCodeSnifferRuleSetPrinter($builderFactory,$printer)), + new PhpCsFixerRuleSetGenerator(new RuleSetPrinter($builderFactory,$printer)), + new PHPCodeSnifferRuleSetGenerator(new RuleSetPrinter($builderFactory,$printer)), ]; foreach ($generators as $generator) { $generator->generate(); diff --git a/composer.json b/composer.json index 984be01..a5c2efc 100644 --- a/composer.json +++ b/composer.json @@ -28,9 +28,9 @@ }, "require": { "php": "^7.2 || ^8.0", - "rector/rector": "^0.12", + "rector/rector": "^0.12.21", "slevomat/coding-standard": "^7.0", - "symplify/easy-coding-standard": "^10.1.4" + "symplify/easy-coding-standard": "^10.2.2" }, "require-dev": { "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0", diff --git a/config/ecs.php b/config/ecs.php index 82230eb..17aafaa 100644 --- a/config/ecs.php +++ b/config/ecs.php @@ -2,16 +2,18 @@ declare(strict_types=1); -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Symplify\EasyCodingStandard\Config\ECSConfig; use Symplify\EasyCodingStandard\ValueObject\Set\SetList; use Zing\CodingStandard\Set\ECSSetList; -return static function (ContainerConfigurator $containerConfigurator): void { - $containerConfigurator->import(SetList::PSR_12); - $containerConfigurator->import(SetList::SYMPLIFY); - $containerConfigurator->import(SetList::COMMON); - $containerConfigurator->import(SetList::CLEAN_CODE); - $containerConfigurator->import(ECSSetList::PHP_CS_FIXER_CUSTOM); - $containerConfigurator->import(ECSSetList::PHP_CODESNIFFER_CUSTOM); - $containerConfigurator->import(ECSSetList::SLEVOMAT_CODING_STANDARD_CUSTOM); +return static function (ECSConfig $ecsConfig): void { + $ecsConfig->sets([ + SetList::PSR_12, + SetList::SYMPLIFY, + SetList::COMMON, + SetList::CLEAN_CODE, + ECSSetList::PHP_CS_FIXER_CUSTOM, + ECSSetList::PHP_CODESNIFFER_CUSTOM, + ECSSetList::SLEVOMAT_CODING_STANDARD_CUSTOM, + ]); }; diff --git a/config/rector.php b/config/rector.php index 6d23f30..3b94d1c 100644 --- a/config/rector.php +++ b/config/rector.php @@ -2,18 +2,20 @@ declare(strict_types=1); +use Rector\Config\RectorConfig; use Rector\Set\ValueObject\SetList; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; use Zing\CodingStandard\Set\RectorSetList; -return static function (ContainerConfigurator $containerConfigurator): void { - $containerConfigurator->import(SetList::CODING_STYLE); - $containerConfigurator->import(SetList::CODE_QUALITY); - $containerConfigurator->import(SetList::DEAD_CODE); - $containerConfigurator->import(SetList::PRIVATIZATION); - $containerConfigurator->import(SetList::NAMING); - $containerConfigurator->import(SetList::EARLY_RETURN); - $containerConfigurator->import(SetList::TYPE_DECLARATION); - $containerConfigurator->import(SetList::TYPE_DECLARATION_STRICT); - $containerConfigurator->import(RectorSetList::FAKER_114); +return static function (RectorConfig $rectorConfig): void { + $rectorConfig->sets([ + SetList::CODING_STYLE, + SetList::CODE_QUALITY, + SetList::DEAD_CODE, + SetList::PRIVATIZATION, + SetList::NAMING, + SetList::EARLY_RETURN, + SetList::TYPE_DECLARATION, + SetList::TYPE_DECLARATION_STRICT, + RectorSetList::FAKER_114, + ]); }; diff --git a/config/set/php-cs-fixer-custom.php b/config/set/php-cs-fixer-custom.php index 7ee6e7b..6e37a08 100644 --- a/config/set/php-cs-fixer-custom.php +++ b/config/set/php-cs-fixer-custom.php @@ -2,375 +2,308 @@ declare(strict_types=1); -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Symplify\EasyCodingStandard\Config\ECSConfig; -return static function (ContainerConfigurator $containerConfigurator): void { - $services = $containerConfigurator->services(); - $services->set(\PhpCsFixer\Fixer\Basic\EncodingFixer::class); - $services->set(\PhpCsFixer\Fixer\PhpTag\FullOpeningTagFixer::class); - $services->set(\PhpCsFixer\Fixer\ClassNotation\NoPhp4ConstructorFixer::class); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitInternalClassFixer::class); - $services->set(\PhpCsFixer\Fixer\ClassNotation\FinalInternalClassFixer::class); - $services->set(\PhpCsFixer\Fixer\ClassNotation\ProtectedToPrivateFixer::class); - $services->set(\PhpCsFixer\Fixer\ClassNotation\OrderedClassElementsFixer::class) - ->call('configure', [ - [ - 'order' => ['use_trait', 'constant_public', 'constant_protected', 'constant_private'], - ], - ]); - $services->set(\PhpCsFixer\Fixer\ClassNotation\SingleClassElementPerStatementFixer::class); - $services->set(\PhpCsFixer\Fixer\ClassNotation\ClassAttributesSeparationFixer::class); - $services->set(\PhpCsFixer\Fixer\Whitespace\IndentationTypeFixer::class); - $services->set(\PhpCsFixer\Fixer\ControlStructure\NoAlternativeSyntaxFixer::class); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\NoUselessSprintfFixer::class); - $services->set(\PhpCsFixer\Fixer\Semicolon\NoEmptyStatementFixer::class); - $services->set(\PhpCsFixer\Fixer\ControlStructure\NoUnneededCurlyBracesFixer::class) - ->call('configure', [ - [ - 'namespaces' => true, - ], - ]); - $services->set(\PhpCsFixer\Fixer\ControlStructure\ElseifFixer::class); - $services->set(\PhpCsFixer\Fixer\Whitespace\LineEndingFixer::class); - $services->set(\PhpCsFixer\Fixer\Alias\NoAliasFunctionsFixer::class) - ->call('configure', [ - [ - 'sets' => ['@all'], - ], - ]); - $services->set(\PhpCsFixer\Fixer\LanguageConstruct\DirConstantFixer::class); - $services->set(\PhpCsFixer\Fixer\ControlStructure\EmptyLoopBodyFixer::class); - $services->set(\PhpCsFixer\Fixer\ControlStructure\NoSuperfluousElseifFixer::class); - $services->set(\PhpCsFixer\Fixer\ControlStructure\NoUselessElseFixer::class); - $services->set(\PhpCsFixer\Fixer\Operator\NewWithBracesFixer::class); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\ImplodeCallFixer::class); - $services->set(\PhpCsFixer\Fixer\ClassNotation\ClassDefinitionFixer::class) - ->call('configure', [ - [ - 'single_line' => true, - ], - ]); - $services->set(\PhpCsFixer\Fixer\LanguageConstruct\SingleSpaceAfterConstructFixer::class); - $services->set(\PhpCsFixer\Fixer\ClassNotation\SingleTraitInsertPerStatementFixer::class); - $services->set(\PhpCsFixer\Fixer\Basic\BracesFixer::class) - ->call('configure', [ - [ - 'allow_single_line_anonymous_class_with_empty_body' => true, - 'allow_single_line_closure' => true, - ], - ]); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\CombineNestedDirnameFixer::class); - $services->set(\PhpCsFixer\Fixer\Whitespace\MethodChainingIndentationFixer::class); - $services->set(\PhpCsFixer\Fixer\Alias\PowToExponentiationFixer::class); - $services->set(\PhpCsFixer\Fixer\ArrayNotation\NoMultilineWhitespaceAroundDoubleArrowFixer::class); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\FunctionDeclarationFixer::class); - $services->set(\PhpCsFixer\Fixer\Strict\StrictParamFixer::class); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\MethodArgumentSpaceFixer::class) - ->call('configure', [ - [ - 'on_multiline' => 'ensure_fully_multiline', - ], - ]); - $services->set(\PhpCsFixer\Fixer\ControlStructure\NoUnneededControlParenthesesFixer::class) - ->call('configure', [ - [ - 'statements' => [ - 'break', - 'clone', - 'continue', - 'echo_print', - 'return', - 'switch_case', - 'yield', - 'yield_from', - ], - ], - ]); - $services->set(\PhpCsFixer\Fixer\Whitespace\ArrayIndentationFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\AlignMultilineCommentFixer::class); - $services->set(\PhpCsFixer\Fixer\Comment\CommentToPhpdocFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocToCommentFixer::class); - $services->set(\PhpCsFixer\Fixer\LanguageConstruct\NoUnsetOnPropertyFixer::class); - $services->set(\PhpCsFixer\Fixer\LanguageConstruct\CombineConsecutiveUnsetsFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocIndentFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocAnnotationWithoutDotFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocTypesFixer::class); - $services->set(\PhpCsFixer\Fixer\ReturnNotation\SimplifiedNullReturnFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocScalarFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\GeneralPhpdocTagRenameFixer::class) - ->call('configure', [ - [ - 'replacements' => [ - 'inheritDocs' => 'inheritDoc', - ], - ], - ]); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocNoAliasTagFixer::class) - ->call('configure', [ - [ - 'replacements' => [ - 'type' => 'var', - 'link' => 'see', - ], - ], - ]); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocAddMissingParamAnnotationFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocNoAccessFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocNoPackageFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocReturnSelfReferenceFixer::class); - $services->set(\PhpCsFixer\Fixer\ConstantNotation\NativeConstantInvocationFixer::class) - ->call('configure', [ - [ - 'fix_built_in' => false, - 'include' => ['DIRECTORY_SEPARATOR', 'PHP_INT_SIZE', 'PHP_SAPI', 'PHP_VERSION_ID'], - 'scope' => 'namespaced', - 'strict' => true, - ], - ]); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitTestAnnotationFixer::class); - $services->set(\PhpCsFixer\Fixer\Import\FullyQualifiedStrictTypesFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocLineSpanFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\NoSuperfluousPhpdocTagsFixer::class) - ->call('configure', [ - [ - 'allow_mixed' => true, - 'allow_unused_params' => true, - ], - ]); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocNoUselessInheritdocFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocNoEmptyReturnFixer::class); - $services->set(\PhpCsFixer\Fixer\LanguageConstruct\CombineConsecutiveIssetsFixer::class); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\LambdaNotUsedImportFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\NoEmptyPhpdocFixer::class); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\NoTrailingCommaInSinglelineFunctionCallFixer::class); - $services->set(\PhpCsFixer\Fixer\Alias\BacktickToShellExecFixer::class); - $services->set(\PhpCsFixer\Fixer\Comment\NoEmptyCommentFixer::class); - $services->set(\PhpCsFixer\Fixer\Semicolon\SemicolonAfterInstructionFixer::class); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\NoSpacesAfterFunctionNameFixer::class); - $services->set(\PhpCsFixer\Fixer\Whitespace\NoSpacesInsideParenthesisFixer::class); - $services->set(\PhpCsFixer\Fixer\StringNotation\EscapeImplicitBackslashesFixer::class); - $services->set(\PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer::class); - $services->set(\PhpCsFixer\Fixer\ControlStructure\EmptyLoopConditionFixer::class); - $services->set(\PhpCsFixer\Fixer\Import\NoUnneededImportAliasFixer::class); - $services->set(\PhpCsFixer\Fixer\Comment\SingleLineCommentSpacingFixer::class); - $services->set(\PhpCsFixer\Fixer\Operator\StandardizeIncrementFixer::class); - $services->set(\PhpCsFixer\Fixer\PhpTag\BlankLineAfterOpeningTagFixer::class); - $services->set(\PhpCsFixer\Fixer\Import\SingleImportPerStatementFixer::class); - $services->set(\PhpCsFixer\Fixer\LanguageConstruct\FunctionToConstantFixer::class); - $services->set(\PhpCsFixer\Fixer\LanguageConstruct\IsNullFixer::class); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\NativeFunctionInvocationFixer::class) - ->call('configure', [ - [ - 'include' => ['@compiler_optimized'], - 'scope' => 'namespaced', - 'strict' => true, - ], - ]); - $services->set(\PhpCsFixer\Fixer\StringNotation\StringLengthToEmptyFixer::class); - $services->set(\PhpCsFixer\Fixer\Operator\TernaryToElvisOperatorFixer::class); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\NullableTypeDeclarationForDefaultNullValueFixer::class); - $services->set(\PhpCsFixer\Fixer\ControlStructure\SimplifiedIfReturnFixer::class); - $services->set(\PhpCsFixer\Fixer\LanguageConstruct\ExplicitIndirectVariableFixer::class); - $services->set(\PhpCsFixer\Fixer\StringNotation\ExplicitStringVariableFixer::class); - $services->set(\PhpCsFixer\Fixer\StringNotation\HeredocToNowdocFixer::class); - $services->set(\PhpCsFixer\Fixer\Comment\MultilineCommentOpeningClosingFixer::class); - $services->set(\PhpCsFixer\Fixer\Semicolon\MultilineWhitespaceBeforeSemicolonsFixer::class); - $services->set(\PhpCsFixer\Fixer\ClassNotation\NoNullPropertyInitializationFixer::class); - $services->set(\PhpCsFixer\Fixer\Operator\OperatorLinebreakFixer::class) - ->call('configure', [ - [ - 'only_booleans' => true, - ], - ]); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocTypesOrderFixer::class) - ->call('configure', [ - [ - 'null_adjustment' => 'always_last', - 'sort_algorithm' => 'none', - ], - ]); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocVarAnnotationCorrectOrderFixer::class); - $services->set(\PhpCsFixer\Fixer\Casing\ClassReferenceNameCasingFixer::class); - $services->set(\PhpCsFixer\Fixer\NamespaceNotation\CleanNamespaceFixer::class); - $services->set(\PhpCsFixer\Fixer\Operator\ConcatSpaceFixer::class) - ->call('configure', [ - [ - 'spacing' => 'one', - ], - ]); - $services->set(\PhpCsFixer\Fixer\PhpTag\EchoTagSyntaxFixer::class); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\FunctionTypehintSpaceFixer::class); - $services->set(\PhpCsFixer\Fixer\ControlStructure\IncludeFixer::class); - $services->set(\PhpCsFixer\Fixer\Operator\IncrementStyleFixer::class); - $services->set(\PhpCsFixer\Fixer\Casing\IntegerLiteralCaseFixer::class); - $services->set(\PhpCsFixer\Fixer\PhpTag\LinebreakAfterOpeningTagFixer::class); - $services->set(\PhpCsFixer\Fixer\Casing\MagicConstantCasingFixer::class); - $services->set(\PhpCsFixer\Fixer\Casing\MagicMethodCasingFixer::class); - $services->set(\PhpCsFixer\Fixer\Casing\NativeFunctionCasingFixer::class); - $services->set(\PhpCsFixer\Fixer\Casing\NativeFunctionTypeDeclarationCasingFixer::class); - $services->set(\PhpCsFixer\Fixer\Alias\NoAliasLanguageConstructCallFixer::class); - $services->set(\PhpCsFixer\Fixer\StringNotation\NoBinaryStringFixer::class); - $services->set(\PhpCsFixer\Fixer\NamespaceNotation\NoLeadingNamespaceWhitespaceFixer::class); - $services->set(\PhpCsFixer\Fixer\Semicolon\NoSinglelineWhitespaceBeforeSemicolonsFixer::class); - $services->set(\PhpCsFixer\Fixer\Whitespace\NoSpacesAroundOffsetFixer::class); - $services->set(\PhpCsFixer\Fixer\ControlStructure\NoTrailingCommaInListCallFixer::class); - $services->set(\PhpCsFixer\Fixer\ArrayNotation\NoTrailingCommaInSinglelineArrayFixer::class); - $services->set(\PhpCsFixer\Fixer\CastNotation\NoUnsetCastFixer::class); - $services->set(\PhpCsFixer\Fixer\ArrayNotation\NoWhitespaceBeforeCommaInArrayFixer::class); - $services->set(\PhpCsFixer\Fixer\ArrayNotation\NormalizeIndexBraceFixer::class); - $services->set(\PhpCsFixer\Fixer\Operator\ObjectOperatorWithoutWhitespaceFixer::class); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitMethodCasingFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocInlineTagNormalizerFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocSummaryFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocTagTypeFixer::class) - ->call('configure', [ - [ - 'tags' => [ - 'inheritDoc' => 'inline', - ], - ], - ]); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocVarWithoutNameFixer::class); - $services->set(\PhpCsFixer\Fixer\StringNotation\SingleQuoteFixer::class); - $services->set(\PhpCsFixer\Fixer\Operator\StandardizeNotEqualsFixer::class); - $services->set(\PhpCsFixer\Fixer\ControlStructure\SwitchContinueToBreakFixer::class); - $services->set(\PhpCsFixer\Fixer\ControlStructure\TrailingCommaInMultilineFixer::class); - $services->set(\PhpCsFixer\Fixer\ArrayNotation\TrimArraySpacesFixer::class); - $services->set(\PhpCsFixer\Fixer\Whitespace\TypesSpacesFixer::class); - $services->set(\PhpCsFixer\Fixer\Operator\UnaryOperatorSpacesFixer::class); - $services->set(\PhpCsFixer\Fixer\ArrayNotation\WhitespaceAfterCommaInArrayFixer::class); - $services->set(\PhpCsFixer\Fixer\Whitespace\CompactNullableTypehintFixer::class); - $services->set(\PhpCsFixer\Fixer\LanguageConstruct\DeclareEqualNormalizeFixer::class); - $services->set(\PhpCsFixer\Fixer\CastNotation\LowercaseCastFixer::class); - $services->set(\PhpCsFixer\Fixer\Casing\LowercaseStaticReferenceFixer::class); - $services->set(\PhpCsFixer\Fixer\ClassNotation\NoBlankLinesAfterClassOpeningFixer::class); - $services->set(\PhpCsFixer\Fixer\CastNotation\ShortScalarCastFixer::class); - $services->set(\PhpCsFixer\Fixer\Operator\TernaryOperatorSpacesFixer::class); - $services->set(\PhpCsFixer\Fixer\ClassNotation\VisibilityRequiredFixer::class); - $services->set(\PhpCsFixer\Fixer\Casing\ConstantCaseFixer::class); - $services->set(\PhpCsFixer\Fixer\Casing\LowercaseKeywordsFixer::class); - $services->set(\PhpCsFixer\Fixer\ControlStructure\NoBreakCommentFixer::class); - $services->set(\PhpCsFixer\Fixer\PhpTag\NoClosingTagFixer::class); - $services->set(\PhpCsFixer\Fixer\Operator\NoSpaceAroundDoubleColonFixer::class); - $services->set(\PhpCsFixer\Fixer\Whitespace\NoTrailingWhitespaceFixer::class); - $services->set(\PhpCsFixer\Fixer\Comment\NoTrailingWhitespaceInCommentFixer::class); - $services->set(\PhpCsFixer\Fixer\ControlStructure\SwitchCaseSemicolonToColonFixer::class); - $services->set(\PhpCsFixer\Fixer\ControlStructure\SwitchCaseSpaceFixer::class); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\NoUnreachableDefaultArgumentValueFixer::class); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitStrictFixer::class); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitTestCaseStaticMethodCallsFixer::class); - $services->set(\PhpCsFixer\Fixer\Strict\StrictComparisonFixer::class); - $services->set(\PhpCsFixer\Fixer\Alias\ArrayPushFixer::class); - $services->set(\PhpCsFixer\Fixer\Alias\EregToPregFixer::class); - $services->set(\PhpCsFixer\Fixer\LanguageConstruct\ErrorSuppressionFixer::class); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\FopenFlagOrderFixer::class); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\FopenFlagsFixer::class) - ->call('configure', [ - [ - 'b_mode' => false, - ], - ]); - $services->set(\PhpCsFixer\Fixer\Operator\LogicalOperatorsFixer::class); - $services->set(\PhpCsFixer\Fixer\CastNotation\ModernizeTypesCastingFixer::class); - $services->set(\PhpCsFixer\Fixer\Naming\NoHomoglyphNamesFixer::class); - $services->set(\PhpCsFixer\Fixer\ClassNotation\NoUnneededFinalMethodFixer::class); - $services->set(\PhpCsFixer\Fixer\Basic\NonPrintableCharacterFixer::class); - $services->set(\PhpCsFixer\Fixer\ClassNotation\OrderedTraitsFixer::class); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitMockShortWillReturnFixer::class); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitSetUpTearDownVisibilityFixer::class); - $services->set(\PhpCsFixer\Fixer\ClassNotation\SelfAccessorFixer::class); - $services->set(\PhpCsFixer\Fixer\Alias\SetTypeToCastFixer::class); - $services->set(\PhpCsFixer\Fixer\StringNotation\StringLineEndingFixer::class); - $services->set(\PhpCsFixer\Fixer\StringNotation\NoTrailingWhitespaceInStringFixer::class); - $services->set(\PhpCsFixer\Fixer\ControlStructure\ControlStructureContinuationPositionFixer::class); - $services->set(\PhpCsFixer\Fixer\LanguageConstruct\DeclareParenthesesFixer::class); - $services->set(\PhpCsFixer\Fixer\Semicolon\SpaceAfterSemicolonFixer::class) - ->call('configure', [ - [ - 'remove_in_empty_for_expressions' => true, - ], - ]); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocOrderFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocSeparationFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocTrimFixer::class); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitConstructFixer::class); - $services->set(\PhpCsFixer\Fixer\CastNotation\NoShortBoolCastFixer::class); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitFqcnAnnotationFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocOrderByValueFixer::class); - $services->set(\PhpCsFixer\Fixer\StringNotation\SimpleToComplexStringVariableFixer::class); - $services->set(\PhpCsFixer\Fixer\CastNotation\CastSpacesFixer::class); - $services->set(\PhpCsFixer\Fixer\Alias\NoMixedEchoPrintFixer::class); - $services->set(\PhpCsFixer\Fixer\Import\NoUnusedImportsFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocSingleLineVarSpacingFixer::class); - $services->set(\PhpCsFixer\Fixer\Basic\PsrAutoloadingFixer::class); - $services->set(\PhpCsFixer\Fixer\Operator\NotOperatorWithSuccessorSpaceFixer::class); - $services->set(\PhpCsFixer\Fixer\ClassNotation\SelfStaticAccessorFixer::class); - $services->set(\PhpCsFixer\Fixer\Import\SingleLineAfterImportsFixer::class); - $services->set(\PhpCsFixer\Fixer\ReturnNotation\ReturnAssignmentFixer::class); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\ReturnTypeDeclarationFixer::class); - $services->set(\PhpCsFixer\Fixer\ReturnNotation\NoUselessReturnFixer::class); - $services->set(\PhpCsFixer\Fixer\Whitespace\NoWhitespaceInBlankLineFixer::class); - $services->set(\PhpCsFixer\Fixer\Whitespace\NoExtraBlankLinesFixer::class) - ->call('configure', [ - [ - 'tokens' => [ - 'break', - 'case', - 'continue', - 'curly_brace_block', - 'default', - 'extra', - 'parenthesis_brace_block', - 'return', - 'square_brace_block', - 'switch', - 'throw', - 'use', - ], - ], - ]); - $services->set(\PhpCsFixer\Fixer\Phpdoc\NoBlankLinesAfterPhpdocFixer::class); - $services->set(\PhpCsFixer\Fixer\Import\NoLeadingImportSlashFixer::class); - $services->set(\PhpCsFixer\Fixer\NamespaceNotation\BlankLineAfterNamespaceFixer::class); - $services->set(\PhpCsFixer\Fixer\Whitespace\BlankLineBeforeStatementFixer::class) - ->call('configure', [ - [ - 'statements' => [ - 'break', - 'case', - 'continue', - 'declare', - 'default', - 'exit', - 'goto', - 'include', - 'include_once', - 'phpdoc', - 'require', - 'require_once', - 'return', - 'switch', - 'throw', - 'try', - 'yield', - ], - ], - ]); - $services->set(\PhpCsFixer\Fixer\NamespaceNotation\SingleBlankLineBeforeNamespaceFixer::class); - $services->set(\PhpCsFixer\Fixer\Import\OrderedImportsFixer::class) - ->call('configure', [ - [ - 'imports_order' => ['class', 'function', 'const'], - ], - ]); - $services->set(\PhpCsFixer\Fixer\Comment\SingleLineCommentStyleFixer::class); - $services->set(\PhpCsFixer\Fixer\Operator\BinaryOperatorSpacesFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocTrimConsecutiveBlankLineSeparationFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocAlignFixer::class) - ->call('configure', [ - [ - 'align' => 'left', - ], - ]); - $services->set(\PhpCsFixer\Fixer\Whitespace\SingleBlankLineAtEofFixer::class); +return static function (ECSConfig $containerConfigurator): void { + $containerConfigurator->rule(\PhpCsFixer\Fixer\Basic\EncodingFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\PhpTag\FullOpeningTagFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ClassNotation\NoPhp4ConstructorFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\PhpUnit\PhpUnitInternalClassFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ClassNotation\FinalInternalClassFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ClassNotation\ProtectedToPrivateFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\ClassNotation\OrderedClassElementsFixer::class, [ + 'order' => ['use_trait', 'constant_public', 'constant_protected', 'constant_private'], + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ClassNotation\SingleClassElementPerStatementFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ClassNotation\ClassAttributesSeparationFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Whitespace\IndentationTypeFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ControlStructure\NoAlternativeSyntaxFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\FunctionNotation\NoUselessSprintfFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Semicolon\NoEmptyStatementFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\ControlStructure\NoUnneededCurlyBracesFixer::class, [ + 'namespaces' => true, + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ControlStructure\ElseifFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Whitespace\LineEndingFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\Alias\NoAliasFunctionsFixer::class, [ + 'sets' => ['@all'], + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\LanguageConstruct\DirConstantFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ControlStructure\EmptyLoopBodyFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ControlStructure\NoSuperfluousElseifFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ControlStructure\NoUselessElseFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Operator\NewWithBracesFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\FunctionNotation\ImplodeCallFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\ClassNotation\ClassDefinitionFixer::class, [ + 'single_line' => true, + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\LanguageConstruct\SingleSpaceAfterConstructFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ClassNotation\SingleTraitInsertPerStatementFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\Basic\BracesFixer::class, [ + 'allow_single_line_anonymous_class_with_empty_body' => true, + 'allow_single_line_closure' => true, + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\FunctionNotation\CombineNestedDirnameFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Whitespace\MethodChainingIndentationFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Alias\PowToExponentiationFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ArrayNotation\NoMultilineWhitespaceAroundDoubleArrowFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\FunctionNotation\FunctionDeclarationFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Strict\StrictParamFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\FunctionNotation\MethodArgumentSpaceFixer::class, [ + 'on_multiline' => 'ensure_fully_multiline', + ]); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\ControlStructure\NoUnneededControlParenthesesFixer::class, [ + 'statements' => [ + 'break', + 'clone', + 'continue', + 'echo_print', + 'return', + 'switch_case', + 'yield', + 'yield_from', + ], + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Whitespace\ArrayIndentationFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\AlignMultilineCommentFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Comment\CommentToPhpdocFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocToCommentFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\LanguageConstruct\NoUnsetOnPropertyFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\LanguageConstruct\CombineConsecutiveUnsetsFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocIndentFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocAnnotationWithoutDotFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocTypesFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ReturnNotation\SimplifiedNullReturnFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocScalarFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\Phpdoc\GeneralPhpdocTagRenameFixer::class, [ + 'replacements' => [ + 'inheritDocs' => 'inheritDoc', + ], + ]); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\Phpdoc\PhpdocNoAliasTagFixer::class, [ + 'replacements' => [ + 'type' => 'var', + 'link' => 'see', + ], + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocAddMissingParamAnnotationFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocNoAccessFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocNoPackageFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocReturnSelfReferenceFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\ConstantNotation\NativeConstantInvocationFixer::class, [ + 'fix_built_in' => false, + 'include' => ['DIRECTORY_SEPARATOR', 'PHP_INT_SIZE', 'PHP_SAPI', 'PHP_VERSION_ID'], + 'scope' => 'namespaced', + 'strict' => true, + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\PhpUnit\PhpUnitTestAnnotationFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Import\FullyQualifiedStrictTypesFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocLineSpanFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\Phpdoc\NoSuperfluousPhpdocTagsFixer::class, [ + 'allow_mixed' => true, + 'allow_unused_params' => true, + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocNoUselessInheritdocFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocNoEmptyReturnFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\LanguageConstruct\CombineConsecutiveIssetsFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\FunctionNotation\LambdaNotUsedImportFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\NoEmptyPhpdocFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\FunctionNotation\NoTrailingCommaInSinglelineFunctionCallFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Alias\BacktickToShellExecFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Comment\NoEmptyCommentFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Semicolon\SemicolonAfterInstructionFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\FunctionNotation\NoSpacesAfterFunctionNameFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Whitespace\NoSpacesInsideParenthesisFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\StringNotation\EscapeImplicitBackslashesFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ControlStructure\EmptyLoopConditionFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Import\NoUnneededImportAliasFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Comment\SingleLineCommentSpacingFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Operator\StandardizeIncrementFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\PhpTag\BlankLineAfterOpeningTagFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Import\SingleImportPerStatementFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\LanguageConstruct\FunctionToConstantFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\LanguageConstruct\IsNullFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\FunctionNotation\NativeFunctionInvocationFixer::class, [ + 'include' => ['@compiler_optimized'], + 'scope' => 'namespaced', + 'strict' => true, + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\StringNotation\StringLengthToEmptyFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Operator\TernaryToElvisOperatorFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\FunctionNotation\NullableTypeDeclarationForDefaultNullValueFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ControlStructure\SimplifiedIfReturnFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\LanguageConstruct\ExplicitIndirectVariableFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\StringNotation\ExplicitStringVariableFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\StringNotation\HeredocToNowdocFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Comment\MultilineCommentOpeningClosingFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Semicolon\MultilineWhitespaceBeforeSemicolonsFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ClassNotation\NoNullPropertyInitializationFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\Operator\OperatorLinebreakFixer::class, [ + 'only_booleans' => true, + ]); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\Phpdoc\PhpdocTypesOrderFixer::class, [ + 'null_adjustment' => 'always_last', + 'sort_algorithm' => 'none', + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocVarAnnotationCorrectOrderFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Casing\ClassReferenceNameCasingFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\NamespaceNotation\CleanNamespaceFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\Operator\ConcatSpaceFixer::class, [ + 'spacing' => 'one', + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\PhpTag\EchoTagSyntaxFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\FunctionNotation\FunctionTypehintSpaceFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ControlStructure\IncludeFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Operator\IncrementStyleFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Casing\IntegerLiteralCaseFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\PhpTag\LinebreakAfterOpeningTagFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Casing\MagicConstantCasingFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Casing\MagicMethodCasingFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Casing\NativeFunctionCasingFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Casing\NativeFunctionTypeDeclarationCasingFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Alias\NoAliasLanguageConstructCallFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\StringNotation\NoBinaryStringFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\NamespaceNotation\NoLeadingNamespaceWhitespaceFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Semicolon\NoSinglelineWhitespaceBeforeSemicolonsFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Whitespace\NoSpacesAroundOffsetFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ControlStructure\NoTrailingCommaInListCallFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ArrayNotation\NoTrailingCommaInSinglelineArrayFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\CastNotation\NoUnsetCastFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ArrayNotation\NoWhitespaceBeforeCommaInArrayFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ArrayNotation\NormalizeIndexBraceFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Operator\ObjectOperatorWithoutWhitespaceFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\PhpUnit\PhpUnitMethodCasingFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocInlineTagNormalizerFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocSummaryFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\Phpdoc\PhpdocTagTypeFixer::class, [ + 'tags' => [ + 'inheritDoc' => 'inline', + ], + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocVarWithoutNameFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\StringNotation\SingleQuoteFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Operator\StandardizeNotEqualsFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ControlStructure\SwitchContinueToBreakFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ControlStructure\TrailingCommaInMultilineFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ArrayNotation\TrimArraySpacesFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Whitespace\TypesSpacesFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Operator\UnaryOperatorSpacesFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ArrayNotation\WhitespaceAfterCommaInArrayFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Whitespace\CompactNullableTypehintFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\LanguageConstruct\DeclareEqualNormalizeFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\CastNotation\LowercaseCastFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Casing\LowercaseStaticReferenceFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ClassNotation\NoBlankLinesAfterClassOpeningFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\CastNotation\ShortScalarCastFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Operator\TernaryOperatorSpacesFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ClassNotation\VisibilityRequiredFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Casing\ConstantCaseFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Casing\LowercaseKeywordsFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ControlStructure\NoBreakCommentFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\PhpTag\NoClosingTagFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Operator\NoSpaceAroundDoubleColonFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Whitespace\NoTrailingWhitespaceFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Comment\NoTrailingWhitespaceInCommentFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ControlStructure\SwitchCaseSemicolonToColonFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ControlStructure\SwitchCaseSpaceFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\FunctionNotation\NoUnreachableDefaultArgumentValueFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\PhpUnit\PhpUnitStrictFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\PhpUnit\PhpUnitTestCaseStaticMethodCallsFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Strict\StrictComparisonFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Alias\ArrayPushFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Alias\EregToPregFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\LanguageConstruct\ErrorSuppressionFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\FunctionNotation\FopenFlagOrderFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\FunctionNotation\FopenFlagsFixer::class, [ + 'b_mode' => false, + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Operator\LogicalOperatorsFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\CastNotation\ModernizeTypesCastingFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Naming\NoHomoglyphNamesFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ClassNotation\NoUnneededFinalMethodFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Basic\NonPrintableCharacterFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ClassNotation\OrderedTraitsFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\PhpUnit\PhpUnitMockShortWillReturnFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\PhpUnit\PhpUnitSetUpTearDownVisibilityFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ClassNotation\SelfAccessorFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Alias\SetTypeToCastFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\StringNotation\StringLineEndingFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\StringNotation\NoTrailingWhitespaceInStringFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ControlStructure\ControlStructureContinuationPositionFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\LanguageConstruct\DeclareParenthesesFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\Semicolon\SpaceAfterSemicolonFixer::class, [ + 'remove_in_empty_for_expressions' => true, + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocOrderFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocSeparationFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocTrimFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\PhpUnit\PhpUnitConstructFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\CastNotation\NoShortBoolCastFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\PhpUnit\PhpUnitFqcnAnnotationFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocOrderByValueFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\StringNotation\SimpleToComplexStringVariableFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\CastNotation\CastSpacesFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Alias\NoMixedEchoPrintFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Import\NoUnusedImportsFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocSingleLineVarSpacingFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Basic\PsrAutoloadingFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Operator\NotOperatorWithSuccessorSpaceFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ClassNotation\SelfStaticAccessorFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Import\SingleLineAfterImportsFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ReturnNotation\ReturnAssignmentFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\FunctionNotation\ReturnTypeDeclarationFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ReturnNotation\NoUselessReturnFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Whitespace\NoWhitespaceInBlankLineFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\Whitespace\NoExtraBlankLinesFixer::class, [ + 'tokens' => [ + 'break', + 'case', + 'continue', + 'curly_brace_block', + 'default', + 'extra', + 'parenthesis_brace_block', + 'return', + 'square_brace_block', + 'switch', + 'throw', + 'use', + ], + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\NoBlankLinesAfterPhpdocFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Import\NoLeadingImportSlashFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\NamespaceNotation\BlankLineAfterNamespaceFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\Whitespace\BlankLineBeforeStatementFixer::class, [ + 'statements' => [ + 'break', + 'case', + 'continue', + 'declare', + 'default', + 'exit', + 'goto', + 'include', + 'include_once', + 'phpdoc', + 'require', + 'require_once', + 'return', + 'switch', + 'throw', + 'try', + 'yield', + ], + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\NamespaceNotation\SingleBlankLineBeforeNamespaceFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\Import\OrderedImportsFixer::class, [ + 'imports_order' => ['class', 'function', 'const'], + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Comment\SingleLineCommentStyleFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Operator\BinaryOperatorSpacesFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocTrimConsecutiveBlankLineSeparationFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\Phpdoc\PhpdocAlignFixer::class, [ + 'align' => 'left', + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Whitespace\SingleBlankLineAtEofFixer::class); }; diff --git a/config/set/php-cs-fixer/doctrine-annotation.php b/config/set/php-cs-fixer/doctrine-annotation.php index 88cf99a..098c8d4 100644 --- a/config/set/php-cs-fixer/doctrine-annotation.php +++ b/config/set/php-cs-fixer/doctrine-annotation.php @@ -2,22 +2,15 @@ declare(strict_types=1); -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Symplify\EasyCodingStandard\Config\ECSConfig; -return static function (ContainerConfigurator $containerConfigurator): void { - $services = $containerConfigurator->services(); - $services->set(\PhpCsFixer\Fixer\DoctrineAnnotation\DoctrineAnnotationArrayAssignmentFixer::class) - ->call('configure', [ - [ - 'operator' => ':', - ], - ]); - $services->set(\PhpCsFixer\Fixer\DoctrineAnnotation\DoctrineAnnotationBracesFixer::class); - $services->set(\PhpCsFixer\Fixer\DoctrineAnnotation\DoctrineAnnotationIndentationFixer::class); - $services->set(\PhpCsFixer\Fixer\DoctrineAnnotation\DoctrineAnnotationSpacesFixer::class) - ->call('configure', [ - [ - 'before_array_assignments_colon' => false, - ], - ]); +return static function (ECSConfig $containerConfigurator): void { + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\DoctrineAnnotation\DoctrineAnnotationArrayAssignmentFixer::class, [ + 'operator' => ':', + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\DoctrineAnnotation\DoctrineAnnotationBracesFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\DoctrineAnnotation\DoctrineAnnotationIndentationFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\DoctrineAnnotation\DoctrineAnnotationSpacesFixer::class, [ + 'before_array_assignments_colon' => false, + ]); }; diff --git a/config/set/php-cs-fixer/laravel.php b/config/set/php-cs-fixer/laravel.php index 2b38b8c..6844464 100644 --- a/config/set/php-cs-fixer/laravel.php +++ b/config/set/php-cs-fixer/laravel.php @@ -2,207 +2,149 @@ declare(strict_types=1); -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Symplify\EasyCodingStandard\Config\ECSConfig; -return static function (ContainerConfigurator $containerConfigurator): void { - $services = $containerConfigurator->services(); - $services->set(\PhpCsFixer\Fixer\Basic\EncodingFixer::class); - $services->set(\PhpCsFixer\Fixer\PhpTag\FullOpeningTagFixer::class); - $services->set(\PhpCsFixer\Fixer\ClassNotation\SingleClassElementPerStatementFixer::class) - ->call('configure', [ - [ - 'elements' => ['const', 'property'], - ], - ]); - $services->set(\PhpCsFixer\Fixer\ClassNotation\ClassAttributesSeparationFixer::class) - ->call('configure', [ - [ - 'elements' => [ - 'const' => 'one', - 'method' => 'one', - 'property' => 'one', - 'trait_import' => 'none', - ], - ], - ]); - $services->set(\PhpCsFixer\Fixer\Whitespace\IndentationTypeFixer::class); - $services->set(\PhpCsFixer\Fixer\ControlStructure\ElseifFixer::class); - $services->set(\PhpCsFixer\Fixer\Whitespace\LineEndingFixer::class); - $services->set(\PhpCsFixer\Fixer\Alias\NoAliasFunctionsFixer::class); - $services->set(\PhpCsFixer\Fixer\Semicolon\NoEmptyStatementFixer::class); - $services->set(\PhpCsFixer\Fixer\ClassNotation\ClassDefinitionFixer::class) - ->call('configure', [ - [ - 'multi_line_extends_each_single_line' => true, - 'single_item_single_line' => true, - 'single_line' => true, - ], - ]); - $services->set(\PhpCsFixer\Fixer\Basic\BracesFixer::class); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\FunctionDeclarationFixer::class); - $services->set(\PhpCsFixer\Fixer\ArrayNotation\NoMultilineWhitespaceAroundDoubleArrowFixer::class); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\MethodArgumentSpaceFixer::class) - ->call('configure', [ - [ - 'on_multiline' => 'ignore', - ], - ]); - $services->set(\PhpCsFixer\Fixer\ControlStructure\NoUnneededControlParenthesesFixer::class) - ->call('configure', [ - [ - 'statements' => ['break', 'clone', 'continue', 'echo_print', 'return', 'switch_case', 'yield'], - ], - ]); - $services->set(\PhpCsFixer\Fixer\Whitespace\ArrayIndentationFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocIndentFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocTypesFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocScalarFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\GeneralPhpdocTagRenameFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocNoAccessFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocNoPackageFixer::class); - $services->set(\PhpCsFixer\Fixer\Import\FullyQualifiedStrictTypesFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocNoUselessInheritdocFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\NoEmptyPhpdocFixer::class); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\NoSpacesAfterFunctionNameFixer::class); - $services->set(\PhpCsFixer\Fixer\Whitespace\NoSpacesInsideParenthesisFixer::class); - $services->set(\PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer::class) - ->call('configure', [ - [ - 'syntax' => 'short', - ], - ]); - $services->set(\PhpCsFixer\Fixer\PhpTag\BlankLineAfterOpeningTagFixer::class); - $services->set(\PhpCsFixer\Fixer\Import\SingleImportPerStatementFixer::class); - $services->set(\PhpCsFixer\Fixer\Operator\ConcatSpaceFixer::class) - ->call('configure', [ - [ - 'spacing' => 'none', - ], - ]); - $services->set(\PhpCsFixer\Fixer\Casing\ConstantCaseFixer::class) - ->call('configure', [ - [ - 'case' => 'lower', - ], - ]); - $services->set(\PhpCsFixer\Fixer\LanguageConstruct\DeclareEqualNormalizeFixer::class); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\FunctionTypehintSpaceFixer::class); - $services->set(\PhpCsFixer\Fixer\StringNotation\HeredocToNowdocFixer::class); - $services->set(\PhpCsFixer\Fixer\ControlStructure\IncludeFixer::class); - $services->set(\PhpCsFixer\Fixer\Operator\IncrementStyleFixer::class) - ->call('configure', [ - [ - 'style' => 'post', - ], - ]); - $services->set(\PhpCsFixer\Fixer\PhpTag\LinebreakAfterOpeningTagFixer::class); - $services->set(\PhpCsFixer\Fixer\CastNotation\LowercaseCastFixer::class); - $services->set(\PhpCsFixer\Fixer\Casing\LowercaseKeywordsFixer::class); - $services->set(\PhpCsFixer\Fixer\Casing\LowercaseStaticReferenceFixer::class); - $services->set(\PhpCsFixer\Fixer\Casing\MagicMethodCasingFixer::class); - $services->set(\PhpCsFixer\Fixer\Casing\MagicConstantCasingFixer::class); - $services->set(\PhpCsFixer\Fixer\Semicolon\MultilineWhitespaceBeforeSemicolonsFixer::class) - ->call('configure', [ - [ - 'strategy' => 'no_multi_line', - ], - ]); - $services->set(\PhpCsFixer\Fixer\Casing\NativeFunctionCasingFixer::class); - $services->set(\PhpCsFixer\Fixer\ClassNotation\NoBlankLinesAfterClassOpeningFixer::class); - $services->set(\PhpCsFixer\Fixer\PhpTag\NoClosingTagFixer::class); - $services->set(\PhpCsFixer\Fixer\NamespaceNotation\NoLeadingNamespaceWhitespaceFixer::class); - $services->set(\PhpCsFixer\Fixer\Semicolon\NoSinglelineWhitespaceBeforeSemicolonsFixer::class); - $services->set(\PhpCsFixer\Fixer\Whitespace\NoSpacesAroundOffsetFixer::class) - ->call('configure', [ - [ - 'positions' => ['inside', 'outside'], - ], - ]); - $services->set(\PhpCsFixer\Fixer\ControlStructure\NoTrailingCommaInListCallFixer::class); - $services->set(\PhpCsFixer\Fixer\ArrayNotation\NoTrailingCommaInSinglelineArrayFixer::class); - $services->set(\PhpCsFixer\Fixer\Whitespace\NoTrailingWhitespaceFixer::class); - $services->set(\PhpCsFixer\Fixer\Comment\NoTrailingWhitespaceInCommentFixer::class); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\NoUnreachableDefaultArgumentValueFixer::class); - $services->set(\PhpCsFixer\Fixer\ArrayNotation\NoWhitespaceBeforeCommaInArrayFixer::class); - $services->set(\PhpCsFixer\Fixer\ArrayNotation\NormalizeIndexBraceFixer::class); - $services->set(\PhpCsFixer\Fixer\Operator\ObjectOperatorWithoutWhitespaceFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocInlineTagNormalizerFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocTagTypeFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocVarWithoutNameFixer::class); - $services->set(\PhpCsFixer\Fixer\ClassNotation\SelfAccessorFixer::class); - $services->set(\PhpCsFixer\Fixer\CastNotation\ShortScalarCastFixer::class); - $services->set(\PhpCsFixer\Fixer\StringNotation\SingleQuoteFixer::class); - $services->set(\PhpCsFixer\Fixer\Operator\StandardizeNotEqualsFixer::class); - $services->set(\PhpCsFixer\Fixer\ControlStructure\SwitchCaseSemicolonToColonFixer::class); - $services->set(\PhpCsFixer\Fixer\ControlStructure\SwitchCaseSpaceFixer::class); - $services->set(\PhpCsFixer\Fixer\Operator\TernaryOperatorSpacesFixer::class); - $services->set(\PhpCsFixer\Fixer\ControlStructure\TrailingCommaInMultilineFixer::class) - ->call('configure', [ - [ - 'elements' => ['arrays'], - ], - ]); - $services->set(\PhpCsFixer\Fixer\ArrayNotation\TrimArraySpacesFixer::class); - $services->set(\PhpCsFixer\Fixer\Operator\UnaryOperatorSpacesFixer::class); - $services->set(\PhpCsFixer\Fixer\ClassNotation\VisibilityRequiredFixer::class) - ->call('configure', [ - [ - 'elements' => ['method', 'property'], - ], - ]); - $services->set(\PhpCsFixer\Fixer\ArrayNotation\WhitespaceAfterCommaInArrayFixer::class); - $services->set(\PhpCsFixer\Fixer\Semicolon\SpaceAfterSemicolonFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocTrimFixer::class); - $services->set(\PhpCsFixer\Fixer\CastNotation\NoShortBoolCastFixer::class); - $services->set(\PhpCsFixer\Fixer\CastNotation\CastSpacesFixer::class); - $services->set(\PhpCsFixer\Fixer\Alias\NoMixedEchoPrintFixer::class) - ->call('configure', [ - [ - 'use' => 'echo', - ], - ]); - $services->set(\PhpCsFixer\Fixer\Operator\NotOperatorWithSuccessorSpaceFixer::class); - $services->set(\PhpCsFixer\Fixer\Basic\PsrAutoloadingFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocSingleLineVarSpacingFixer::class); - $services->set(\PhpCsFixer\Fixer\Import\SingleLineAfterImportsFixer::class); - $services->set(\PhpCsFixer\Fixer\ReturnNotation\NoUselessReturnFixer::class); - $services->set(\PhpCsFixer\Fixer\Whitespace\NoWhitespaceInBlankLineFixer::class); - $services->set(\PhpCsFixer\Fixer\NamespaceNotation\BlankLineAfterNamespaceFixer::class); - $services->set(\PhpCsFixer\Fixer\Whitespace\NoExtraBlankLinesFixer::class) - ->call('configure', [ - [ - 'tokens' => ['extra', 'throw', 'use'], - ], - ]); - $services->set(\PhpCsFixer\Fixer\Phpdoc\NoBlankLinesAfterPhpdocFixer::class); - $services->set(\PhpCsFixer\Fixer\Import\NoLeadingImportSlashFixer::class); - $services->set(\PhpCsFixer\Fixer\Whitespace\BlankLineBeforeStatementFixer::class) - ->call('configure', [ - [ - 'statements' => ['return'], - ], - ]); - $services->set(\PhpCsFixer\Fixer\NamespaceNotation\SingleBlankLineBeforeNamespaceFixer::class); - $services->set(\PhpCsFixer\Fixer\Import\OrderedImportsFixer::class) - ->call('configure', [ - [ - 'sort_algorithm' => 'alpha', - ], - ]); - $services->set(\PhpCsFixer\Fixer\Comment\SingleLineCommentStyleFixer::class) - ->call('configure', [ - [ - 'comment_types' => ['hash'], - ], - ]); - $services->set(\PhpCsFixer\Fixer\Operator\BinaryOperatorSpacesFixer::class) - ->call('configure', [ - [ - 'default' => 'single_space', - 'operators' => [ - '=>' => null, - ], - ], - ]); - $services->set(\PhpCsFixer\Fixer\Whitespace\SingleBlankLineAtEofFixer::class); +return static function (ECSConfig $containerConfigurator): void { + $containerConfigurator->rule(\PhpCsFixer\Fixer\Basic\EncodingFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\PhpTag\FullOpeningTagFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\ClassNotation\SingleClassElementPerStatementFixer::class, [ + 'elements' => ['const', 'property'], + ]); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\ClassNotation\ClassAttributesSeparationFixer::class, [ + 'elements' => [ + 'const' => 'one', + 'method' => 'one', + 'property' => 'one', + 'trait_import' => 'none', + ], + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Whitespace\IndentationTypeFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ControlStructure\ElseifFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Whitespace\LineEndingFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Alias\NoAliasFunctionsFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Semicolon\NoEmptyStatementFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\ClassNotation\ClassDefinitionFixer::class, [ + 'multi_line_extends_each_single_line' => true, + 'single_item_single_line' => true, + 'single_line' => true, + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Basic\BracesFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\FunctionNotation\FunctionDeclarationFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ArrayNotation\NoMultilineWhitespaceAroundDoubleArrowFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\FunctionNotation\MethodArgumentSpaceFixer::class, [ + 'on_multiline' => 'ignore', + ]); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\ControlStructure\NoUnneededControlParenthesesFixer::class, [ + 'statements' => ['break', 'clone', 'continue', 'echo_print', 'return', 'switch_case', 'yield'], + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Whitespace\ArrayIndentationFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocIndentFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocTypesFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocScalarFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\GeneralPhpdocTagRenameFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocNoAccessFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocNoPackageFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Import\FullyQualifiedStrictTypesFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocNoUselessInheritdocFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\NoEmptyPhpdocFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\FunctionNotation\NoSpacesAfterFunctionNameFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Whitespace\NoSpacesInsideParenthesisFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer::class, [ + 'syntax' => 'short', + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\PhpTag\BlankLineAfterOpeningTagFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Import\SingleImportPerStatementFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\Operator\ConcatSpaceFixer::class, [ + 'spacing' => 'none', + ]); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\Casing\ConstantCaseFixer::class, [ + 'case' => 'lower', + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\LanguageConstruct\DeclareEqualNormalizeFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\FunctionNotation\FunctionTypehintSpaceFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\StringNotation\HeredocToNowdocFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ControlStructure\IncludeFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\Operator\IncrementStyleFixer::class, [ + 'style' => 'post', + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\PhpTag\LinebreakAfterOpeningTagFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\CastNotation\LowercaseCastFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Casing\LowercaseKeywordsFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Casing\LowercaseStaticReferenceFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Casing\MagicMethodCasingFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Casing\MagicConstantCasingFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\Semicolon\MultilineWhitespaceBeforeSemicolonsFixer::class, [ + 'strategy' => 'no_multi_line', + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Casing\NativeFunctionCasingFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ClassNotation\NoBlankLinesAfterClassOpeningFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\PhpTag\NoClosingTagFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\NamespaceNotation\NoLeadingNamespaceWhitespaceFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Semicolon\NoSinglelineWhitespaceBeforeSemicolonsFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\Whitespace\NoSpacesAroundOffsetFixer::class, [ + 'positions' => ['inside', 'outside'], + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ControlStructure\NoTrailingCommaInListCallFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ArrayNotation\NoTrailingCommaInSinglelineArrayFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Whitespace\NoTrailingWhitespaceFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Comment\NoTrailingWhitespaceInCommentFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\FunctionNotation\NoUnreachableDefaultArgumentValueFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ArrayNotation\NoWhitespaceBeforeCommaInArrayFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ArrayNotation\NormalizeIndexBraceFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Operator\ObjectOperatorWithoutWhitespaceFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocInlineTagNormalizerFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocTagTypeFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocVarWithoutNameFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ClassNotation\SelfAccessorFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\CastNotation\ShortScalarCastFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\StringNotation\SingleQuoteFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Operator\StandardizeNotEqualsFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ControlStructure\SwitchCaseSemicolonToColonFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ControlStructure\SwitchCaseSpaceFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Operator\TernaryOperatorSpacesFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\ControlStructure\TrailingCommaInMultilineFixer::class, [ + 'elements' => ['arrays'], + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ArrayNotation\TrimArraySpacesFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Operator\UnaryOperatorSpacesFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\ClassNotation\VisibilityRequiredFixer::class, [ + 'elements' => ['method', 'property'], + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ArrayNotation\WhitespaceAfterCommaInArrayFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Semicolon\SpaceAfterSemicolonFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocTrimFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\CastNotation\NoShortBoolCastFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\CastNotation\CastSpacesFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\Alias\NoMixedEchoPrintFixer::class, [ + 'use' => 'echo', + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Operator\NotOperatorWithSuccessorSpaceFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Basic\PsrAutoloadingFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocSingleLineVarSpacingFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Import\SingleLineAfterImportsFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ReturnNotation\NoUselessReturnFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Whitespace\NoWhitespaceInBlankLineFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\NamespaceNotation\BlankLineAfterNamespaceFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\Whitespace\NoExtraBlankLinesFixer::class, [ + 'tokens' => ['extra', 'throw', 'use'], + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\NoBlankLinesAfterPhpdocFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Import\NoLeadingImportSlashFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\Whitespace\BlankLineBeforeStatementFixer::class, [ + 'statements' => ['return'], + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\NamespaceNotation\SingleBlankLineBeforeNamespaceFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\Import\OrderedImportsFixer::class, [ + 'sort_algorithm' => 'alpha', + ]); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\Comment\SingleLineCommentStyleFixer::class, [ + 'comment_types' => ['hash'], + ]); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\Operator\BinaryOperatorSpacesFixer::class, [ + 'default' => 'single_space', + 'operators' => [ + '=>' => null, + ], + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Whitespace\SingleBlankLineAtEofFixer::class); }; diff --git a/config/set/php-cs-fixer/php-cs-fixer-risky.php b/config/set/php-cs-fixer/php-cs-fixer-risky.php index 3dbfce8..2849863 100644 --- a/config/set/php-cs-fixer/php-cs-fixer-risky.php +++ b/config/set/php-cs-fixer/php-cs-fixer-risky.php @@ -2,74 +2,61 @@ declare(strict_types=1); -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Symplify\EasyCodingStandard\Config\ECSConfig; -return static function (ContainerConfigurator $containerConfigurator): void { - $services = $containerConfigurator->services(); - $services->set(\PhpCsFixer\Fixer\ClassNotation\NoPhp4ConstructorFixer::class); - $services->set(\PhpCsFixer\Fixer\ClassNotation\FinalInternalClassFixer::class); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\NoUselessSprintfFixer::class); - $services->set(\PhpCsFixer\Fixer\LanguageConstruct\DirConstantFixer::class); - $services->set(\PhpCsFixer\Fixer\Alias\NoAliasFunctionsFixer::class) - ->call('configure', [ - [ - 'sets' => ['@all'], - ], - ]); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\ImplodeCallFixer::class); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\CombineNestedDirnameFixer::class); - $services->set(\PhpCsFixer\Fixer\Alias\PowToExponentiationFixer::class); - $services->set(\PhpCsFixer\Fixer\Strict\StrictParamFixer::class); - $services->set(\PhpCsFixer\Fixer\Comment\CommentToPhpdocFixer::class); - $services->set(\PhpCsFixer\Fixer\LanguageConstruct\NoUnsetOnPropertyFixer::class); - $services->set(\PhpCsFixer\Fixer\ConstantNotation\NativeConstantInvocationFixer::class) - ->call('configure', [ - [ - 'fix_built_in' => false, - 'include' => ['DIRECTORY_SEPARATOR', 'PHP_INT_SIZE', 'PHP_SAPI', 'PHP_VERSION_ID'], - 'scope' => 'namespaced', - 'strict' => true, - ], - ]); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitTestAnnotationFixer::class); - $services->set(\PhpCsFixer\Fixer\LanguageConstruct\FunctionToConstantFixer::class); - $services->set(\PhpCsFixer\Fixer\LanguageConstruct\IsNullFixer::class); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\NativeFunctionInvocationFixer::class) - ->call('configure', [ - [ - 'include' => ['@compiler_optimized'], - 'scope' => 'namespaced', - 'strict' => true, - ], - ]); - $services->set(\PhpCsFixer\Fixer\StringNotation\StringLengthToEmptyFixer::class); - $services->set(\PhpCsFixer\Fixer\Operator\TernaryToElvisOperatorFixer::class); - $services->set(\PhpCsFixer\Fixer\Alias\ArrayPushFixer::class); - $services->set(\PhpCsFixer\Fixer\Alias\EregToPregFixer::class); - $services->set(\PhpCsFixer\Fixer\LanguageConstruct\ErrorSuppressionFixer::class); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\FopenFlagOrderFixer::class); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\FopenFlagsFixer::class) - ->call('configure', [ - [ - 'b_mode' => false, - ], - ]); - $services->set(\PhpCsFixer\Fixer\Operator\LogicalOperatorsFixer::class); - $services->set(\PhpCsFixer\Fixer\CastNotation\ModernizeTypesCastingFixer::class); - $services->set(\PhpCsFixer\Fixer\Naming\NoHomoglyphNamesFixer::class); - $services->set(\PhpCsFixer\Fixer\ClassNotation\NoUnneededFinalMethodFixer::class); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\NoUnreachableDefaultArgumentValueFixer::class); - $services->set(\PhpCsFixer\Fixer\Basic\NonPrintableCharacterFixer::class); - $services->set(\PhpCsFixer\Fixer\ClassNotation\OrderedTraitsFixer::class); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitMockShortWillReturnFixer::class); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitSetUpTearDownVisibilityFixer::class); - $services->set(\PhpCsFixer\Fixer\ClassNotation\SelfAccessorFixer::class); - $services->set(\PhpCsFixer\Fixer\Alias\SetTypeToCastFixer::class); - $services->set(\PhpCsFixer\Fixer\StringNotation\StringLineEndingFixer::class); - $services->set(\PhpCsFixer\Fixer\StringNotation\NoTrailingWhitespaceInStringFixer::class); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitStrictFixer::class); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitTestCaseStaticMethodCallsFixer::class); - $services->set(\PhpCsFixer\Fixer\Strict\StrictComparisonFixer::class); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitConstructFixer::class); - $services->set(\PhpCsFixer\Fixer\Basic\PsrAutoloadingFixer::class); +return static function (ECSConfig $containerConfigurator): void { + $containerConfigurator->rule(\PhpCsFixer\Fixer\ClassNotation\NoPhp4ConstructorFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ClassNotation\FinalInternalClassFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\FunctionNotation\NoUselessSprintfFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\LanguageConstruct\DirConstantFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\Alias\NoAliasFunctionsFixer::class, [ + 'sets' => ['@all'], + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\FunctionNotation\ImplodeCallFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\FunctionNotation\CombineNestedDirnameFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Alias\PowToExponentiationFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Strict\StrictParamFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Comment\CommentToPhpdocFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\LanguageConstruct\NoUnsetOnPropertyFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\ConstantNotation\NativeConstantInvocationFixer::class, [ + 'fix_built_in' => false, + 'include' => ['DIRECTORY_SEPARATOR', 'PHP_INT_SIZE', 'PHP_SAPI', 'PHP_VERSION_ID'], + 'scope' => 'namespaced', + 'strict' => true, + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\PhpUnit\PhpUnitTestAnnotationFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\LanguageConstruct\FunctionToConstantFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\LanguageConstruct\IsNullFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\FunctionNotation\NativeFunctionInvocationFixer::class, [ + 'include' => ['@compiler_optimized'], + 'scope' => 'namespaced', + 'strict' => true, + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\StringNotation\StringLengthToEmptyFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Operator\TernaryToElvisOperatorFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Alias\ArrayPushFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Alias\EregToPregFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\LanguageConstruct\ErrorSuppressionFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\FunctionNotation\FopenFlagOrderFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\FunctionNotation\FopenFlagsFixer::class, [ + 'b_mode' => false, + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Operator\LogicalOperatorsFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\CastNotation\ModernizeTypesCastingFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Naming\NoHomoglyphNamesFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ClassNotation\NoUnneededFinalMethodFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\FunctionNotation\NoUnreachableDefaultArgumentValueFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Basic\NonPrintableCharacterFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ClassNotation\OrderedTraitsFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\PhpUnit\PhpUnitMockShortWillReturnFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\PhpUnit\PhpUnitSetUpTearDownVisibilityFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ClassNotation\SelfAccessorFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Alias\SetTypeToCastFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\StringNotation\StringLineEndingFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\StringNotation\NoTrailingWhitespaceInStringFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\PhpUnit\PhpUnitStrictFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\PhpUnit\PhpUnitTestCaseStaticMethodCallsFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Strict\StrictComparisonFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\PhpUnit\PhpUnitConstructFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Basic\PsrAutoloadingFixer::class); }; diff --git a/config/set/php-cs-fixer/php-cs-fixer.php b/config/set/php-cs-fixer/php-cs-fixer.php index e0311e0..07eab54 100644 --- a/config/set/php-cs-fixer/php-cs-fixer.php +++ b/config/set/php-cs-fixer/php-cs-fixer.php @@ -2,281 +2,238 @@ declare(strict_types=1); -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Symplify\EasyCodingStandard\Config\ECSConfig; -return static function (ContainerConfigurator $containerConfigurator): void { - $services = $containerConfigurator->services(); - $services->set(\PhpCsFixer\Fixer\Basic\EncodingFixer::class); - $services->set(\PhpCsFixer\Fixer\PhpTag\FullOpeningTagFixer::class); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitInternalClassFixer::class); - $services->set(\PhpCsFixer\Fixer\ClassNotation\ProtectedToPrivateFixer::class); - $services->set(\PhpCsFixer\Fixer\ClassNotation\OrderedClassElementsFixer::class); - $services->set(\PhpCsFixer\Fixer\ClassNotation\SingleClassElementPerStatementFixer::class); - $services->set(\PhpCsFixer\Fixer\ClassNotation\ClassAttributesSeparationFixer::class) - ->call('configure', [ - [ - 'elements' => [ - 'method' => 'one', - ], - ], - ]); - $services->set(\PhpCsFixer\Fixer\Whitespace\IndentationTypeFixer::class); - $services->set(\PhpCsFixer\Fixer\ControlStructure\NoAlternativeSyntaxFixer::class); - $services->set(\PhpCsFixer\Fixer\Semicolon\NoEmptyStatementFixer::class); - $services->set(\PhpCsFixer\Fixer\ControlStructure\NoUnneededCurlyBracesFixer::class) - ->call('configure', [ - [ - 'namespaces' => true, - ], - ]); - $services->set(\PhpCsFixer\Fixer\ControlStructure\ElseifFixer::class); - $services->set(\PhpCsFixer\Fixer\Whitespace\LineEndingFixer::class); - $services->set(\PhpCsFixer\Fixer\ControlStructure\EmptyLoopBodyFixer::class); - $services->set(\PhpCsFixer\Fixer\ControlStructure\NoSuperfluousElseifFixer::class); - $services->set(\PhpCsFixer\Fixer\ControlStructure\NoUselessElseFixer::class); - $services->set(\PhpCsFixer\Fixer\Operator\NewWithBracesFixer::class); - $services->set(\PhpCsFixer\Fixer\ClassNotation\ClassDefinitionFixer::class) - ->call('configure', [ - [ - 'single_line' => true, - ], - ]); - $services->set(\PhpCsFixer\Fixer\LanguageConstruct\SingleSpaceAfterConstructFixer::class); - $services->set(\PhpCsFixer\Fixer\ClassNotation\SingleTraitInsertPerStatementFixer::class); - $services->set(\PhpCsFixer\Fixer\Basic\BracesFixer::class) - ->call('configure', [ - [ - 'allow_single_line_anonymous_class_with_empty_body' => true, - 'allow_single_line_closure' => true, - ], - ]); - $services->set(\PhpCsFixer\Fixer\Whitespace\MethodChainingIndentationFixer::class); - $services->set(\PhpCsFixer\Fixer\ArrayNotation\NoMultilineWhitespaceAroundDoubleArrowFixer::class); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\FunctionDeclarationFixer::class); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\MethodArgumentSpaceFixer::class) - ->call('configure', [ - [ - 'on_multiline' => 'ensure_fully_multiline', - ], - ]); - $services->set(\PhpCsFixer\Fixer\ControlStructure\NoUnneededControlParenthesesFixer::class) - ->call('configure', [ - [ - 'statements' => [ - 'break', - 'clone', - 'continue', - 'echo_print', - 'return', - 'switch_case', - 'yield', - 'yield_from', - ], - ], - ]); - $services->set(\PhpCsFixer\Fixer\Whitespace\ArrayIndentationFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\AlignMultilineCommentFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocToCommentFixer::class); - $services->set(\PhpCsFixer\Fixer\LanguageConstruct\CombineConsecutiveUnsetsFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocIndentFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocAnnotationWithoutDotFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocTypesFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocScalarFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\GeneralPhpdocTagRenameFixer::class) - ->call('configure', [ - [ - 'replacements' => [ - 'inheritDocs' => 'inheritDoc', - ], - ], - ]); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocNoAliasTagFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocNoAccessFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocNoPackageFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocReturnSelfReferenceFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocAddMissingParamAnnotationFixer::class); - $services->set(\PhpCsFixer\Fixer\Import\FullyQualifiedStrictTypesFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\NoSuperfluousPhpdocTagsFixer::class) - ->call('configure', [ - [ - 'allow_mixed' => true, - 'allow_unused_params' => true, - ], - ]); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocNoUselessInheritdocFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocNoEmptyReturnFixer::class); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\LambdaNotUsedImportFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\NoEmptyPhpdocFixer::class); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\NoTrailingCommaInSinglelineFunctionCallFixer::class); - $services->set(\PhpCsFixer\Fixer\LanguageConstruct\CombineConsecutiveIssetsFixer::class); - $services->set(\PhpCsFixer\Fixer\Alias\BacktickToShellExecFixer::class); - $services->set(\PhpCsFixer\Fixer\Comment\NoEmptyCommentFixer::class); - $services->set(\PhpCsFixer\Fixer\Semicolon\SemicolonAfterInstructionFixer::class); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\NoSpacesAfterFunctionNameFixer::class); - $services->set(\PhpCsFixer\Fixer\Whitespace\NoSpacesInsideParenthesisFixer::class); - $services->set(\PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer::class); - $services->set(\PhpCsFixer\Fixer\ControlStructure\EmptyLoopConditionFixer::class); - $services->set(\PhpCsFixer\Fixer\Import\NoUnneededImportAliasFixer::class); - $services->set(\PhpCsFixer\Fixer\Comment\SingleLineCommentSpacingFixer::class); - $services->set(\PhpCsFixer\Fixer\Operator\StandardizeIncrementFixer::class); - $services->set(\PhpCsFixer\Fixer\PhpTag\BlankLineAfterOpeningTagFixer::class); - $services->set(\PhpCsFixer\Fixer\Import\SingleImportPerStatementFixer::class); - $services->set(\PhpCsFixer\Fixer\StringNotation\EscapeImplicitBackslashesFixer::class); - $services->set(\PhpCsFixer\Fixer\Casing\ClassReferenceNameCasingFixer::class); - $services->set(\PhpCsFixer\Fixer\NamespaceNotation\CleanNamespaceFixer::class); - $services->set(\PhpCsFixer\Fixer\Operator\ConcatSpaceFixer::class); - $services->set(\PhpCsFixer\Fixer\PhpTag\EchoTagSyntaxFixer::class); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\FunctionTypehintSpaceFixer::class); - $services->set(\PhpCsFixer\Fixer\ControlStructure\IncludeFixer::class); - $services->set(\PhpCsFixer\Fixer\Operator\IncrementStyleFixer::class); - $services->set(\PhpCsFixer\Fixer\Casing\IntegerLiteralCaseFixer::class); - $services->set(\PhpCsFixer\Fixer\PhpTag\LinebreakAfterOpeningTagFixer::class); - $services->set(\PhpCsFixer\Fixer\Casing\MagicConstantCasingFixer::class); - $services->set(\PhpCsFixer\Fixer\Casing\MagicMethodCasingFixer::class); - $services->set(\PhpCsFixer\Fixer\Casing\NativeFunctionCasingFixer::class); - $services->set(\PhpCsFixer\Fixer\Casing\NativeFunctionTypeDeclarationCasingFixer::class); - $services->set(\PhpCsFixer\Fixer\Alias\NoAliasLanguageConstructCallFixer::class); - $services->set(\PhpCsFixer\Fixer\StringNotation\NoBinaryStringFixer::class); - $services->set(\PhpCsFixer\Fixer\NamespaceNotation\NoLeadingNamespaceWhitespaceFixer::class); - $services->set(\PhpCsFixer\Fixer\Semicolon\NoSinglelineWhitespaceBeforeSemicolonsFixer::class); - $services->set(\PhpCsFixer\Fixer\Whitespace\NoSpacesAroundOffsetFixer::class); - $services->set(\PhpCsFixer\Fixer\ControlStructure\NoTrailingCommaInListCallFixer::class); - $services->set(\PhpCsFixer\Fixer\ArrayNotation\NoTrailingCommaInSinglelineArrayFixer::class); - $services->set(\PhpCsFixer\Fixer\CastNotation\NoUnsetCastFixer::class); - $services->set(\PhpCsFixer\Fixer\ArrayNotation\NoWhitespaceBeforeCommaInArrayFixer::class); - $services->set(\PhpCsFixer\Fixer\ArrayNotation\NormalizeIndexBraceFixer::class); - $services->set(\PhpCsFixer\Fixer\Operator\ObjectOperatorWithoutWhitespaceFixer::class); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitMethodCasingFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocInlineTagNormalizerFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocSummaryFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocTagTypeFixer::class) - ->call('configure', [ - [ - 'tags' => [ - 'inheritDoc' => 'inline', - ], - ], - ]); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocTypesOrderFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocVarWithoutNameFixer::class); - $services->set(\PhpCsFixer\Fixer\StringNotation\SingleQuoteFixer::class); - $services->set(\PhpCsFixer\Fixer\Operator\StandardizeNotEqualsFixer::class); - $services->set(\PhpCsFixer\Fixer\ControlStructure\SwitchContinueToBreakFixer::class); - $services->set(\PhpCsFixer\Fixer\ControlStructure\TrailingCommaInMultilineFixer::class); - $services->set(\PhpCsFixer\Fixer\ArrayNotation\TrimArraySpacesFixer::class); - $services->set(\PhpCsFixer\Fixer\Whitespace\TypesSpacesFixer::class); - $services->set(\PhpCsFixer\Fixer\Operator\UnaryOperatorSpacesFixer::class); - $services->set(\PhpCsFixer\Fixer\ArrayNotation\WhitespaceAfterCommaInArrayFixer::class); - $services->set(\PhpCsFixer\Fixer\ControlStructure\YodaStyleFixer::class); - $services->set(\PhpCsFixer\Fixer\Whitespace\CompactNullableTypehintFixer::class); - $services->set(\PhpCsFixer\Fixer\LanguageConstruct\DeclareEqualNormalizeFixer::class); - $services->set(\PhpCsFixer\Fixer\CastNotation\LowercaseCastFixer::class); - $services->set(\PhpCsFixer\Fixer\Casing\LowercaseStaticReferenceFixer::class); - $services->set(\PhpCsFixer\Fixer\ClassNotation\NoBlankLinesAfterClassOpeningFixer::class); - $services->set(\PhpCsFixer\Fixer\CastNotation\ShortScalarCastFixer::class); - $services->set(\PhpCsFixer\Fixer\Operator\TernaryOperatorSpacesFixer::class); - $services->set(\PhpCsFixer\Fixer\ClassNotation\VisibilityRequiredFixer::class); - $services->set(\PhpCsFixer\Fixer\Casing\ConstantCaseFixer::class); - $services->set(\PhpCsFixer\Fixer\Casing\LowercaseKeywordsFixer::class); - $services->set(\PhpCsFixer\Fixer\ControlStructure\NoBreakCommentFixer::class); - $services->set(\PhpCsFixer\Fixer\PhpTag\NoClosingTagFixer::class); - $services->set(\PhpCsFixer\Fixer\Operator\NoSpaceAroundDoubleColonFixer::class); - $services->set(\PhpCsFixer\Fixer\Whitespace\NoTrailingWhitespaceFixer::class); - $services->set(\PhpCsFixer\Fixer\Comment\NoTrailingWhitespaceInCommentFixer::class); - $services->set(\PhpCsFixer\Fixer\ControlStructure\SwitchCaseSemicolonToColonFixer::class); - $services->set(\PhpCsFixer\Fixer\ControlStructure\SwitchCaseSpaceFixer::class); - $services->set(\PhpCsFixer\Fixer\LanguageConstruct\ExplicitIndirectVariableFixer::class); - $services->set(\PhpCsFixer\Fixer\StringNotation\ExplicitStringVariableFixer::class); - $services->set(\PhpCsFixer\Fixer\StringNotation\HeredocToNowdocFixer::class); - $services->set(\PhpCsFixer\Fixer\Comment\MultilineCommentOpeningClosingFixer::class); - $services->set(\PhpCsFixer\Fixer\Semicolon\MultilineWhitespaceBeforeSemicolonsFixer::class) - ->call('configure', [ - [ - 'strategy' => 'new_line_for_chained_calls', - ], - ]); - $services->set(\PhpCsFixer\Fixer\ClassNotation\NoNullPropertyInitializationFixer::class); - $services->set(\PhpCsFixer\Fixer\Operator\OperatorLinebreakFixer::class) - ->call('configure', [ - [ - 'only_booleans' => true, - ], - ]); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitTestClassRequiresCoversFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocVarAnnotationCorrectOrderFixer::class); - $services->set(\PhpCsFixer\Fixer\Semicolon\SpaceAfterSemicolonFixer::class) - ->call('configure', [ - [ - 'remove_in_empty_for_expressions' => true, - ], - ]); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocOrderFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocSeparationFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocTrimFixer::class); - $services->set(\PhpCsFixer\Fixer\CastNotation\NoShortBoolCastFixer::class); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitFqcnAnnotationFixer::class); - $services->set(\PhpCsFixer\Fixer\CastNotation\CastSpacesFixer::class); - $services->set(\PhpCsFixer\Fixer\Alias\NoMixedEchoPrintFixer::class); - $services->set(\PhpCsFixer\Fixer\Import\NoUnusedImportsFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocSingleLineVarSpacingFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocOrderByValueFixer::class); - $services->set(\PhpCsFixer\Fixer\StringNotation\SimpleToComplexStringVariableFixer::class); - $services->set(\PhpCsFixer\Fixer\Import\SingleLineAfterImportsFixer::class); - $services->set(\PhpCsFixer\Fixer\ReturnNotation\ReturnAssignmentFixer::class); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\ReturnTypeDeclarationFixer::class); - $services->set(\PhpCsFixer\Fixer\ReturnNotation\NoUselessReturnFixer::class); - $services->set(\PhpCsFixer\Fixer\Whitespace\NoWhitespaceInBlankLineFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\NoBlankLinesAfterPhpdocFixer::class); - $services->set(\PhpCsFixer\Fixer\Whitespace\NoExtraBlankLinesFixer::class) - ->call('configure', [ - [ - 'tokens' => [ - 'break', - 'case', - 'continue', - 'curly_brace_block', - 'default', - 'extra', - 'parenthesis_brace_block', - 'return', - 'square_brace_block', - 'switch', - 'throw', - 'use', - ], - ], - ]); - $services->set(\PhpCsFixer\Fixer\Import\NoLeadingImportSlashFixer::class); - $services->set(\PhpCsFixer\Fixer\NamespaceNotation\BlankLineAfterNamespaceFixer::class); - $services->set(\PhpCsFixer\Fixer\Whitespace\BlankLineBeforeStatementFixer::class) - ->call('configure', [ - [ - 'statements' => [ - 'break', - 'case', - 'continue', - 'declare', - 'default', - 'exit', - 'goto', - 'include', - 'include_once', - 'phpdoc', - 'require', - 'require_once', - 'return', - 'switch', - 'throw', - 'try', - 'yield', - ], - ], - ]); - $services->set(\PhpCsFixer\Fixer\NamespaceNotation\SingleBlankLineBeforeNamespaceFixer::class); - $services->set(\PhpCsFixer\Fixer\Import\OrderedImportsFixer::class); - $services->set(\PhpCsFixer\Fixer\Comment\SingleLineCommentStyleFixer::class); - $services->set(\PhpCsFixer\Fixer\Operator\BinaryOperatorSpacesFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocTrimConsecutiveBlankLineSeparationFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocAlignFixer::class); - $services->set(\PhpCsFixer\Fixer\Whitespace\SingleBlankLineAtEofFixer::class); +return static function (ECSConfig $containerConfigurator): void { + $containerConfigurator->rule(\PhpCsFixer\Fixer\Basic\EncodingFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\PhpTag\FullOpeningTagFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\PhpUnit\PhpUnitInternalClassFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ClassNotation\ProtectedToPrivateFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ClassNotation\OrderedClassElementsFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ClassNotation\SingleClassElementPerStatementFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\ClassNotation\ClassAttributesSeparationFixer::class, [ + 'elements' => [ + 'method' => 'one', + ], + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Whitespace\IndentationTypeFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ControlStructure\NoAlternativeSyntaxFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Semicolon\NoEmptyStatementFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\ControlStructure\NoUnneededCurlyBracesFixer::class, [ + 'namespaces' => true, + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ControlStructure\ElseifFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Whitespace\LineEndingFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ControlStructure\EmptyLoopBodyFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ControlStructure\NoSuperfluousElseifFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ControlStructure\NoUselessElseFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Operator\NewWithBracesFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\ClassNotation\ClassDefinitionFixer::class, [ + 'single_line' => true, + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\LanguageConstruct\SingleSpaceAfterConstructFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ClassNotation\SingleTraitInsertPerStatementFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\Basic\BracesFixer::class, [ + 'allow_single_line_anonymous_class_with_empty_body' => true, + 'allow_single_line_closure' => true, + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Whitespace\MethodChainingIndentationFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ArrayNotation\NoMultilineWhitespaceAroundDoubleArrowFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\FunctionNotation\FunctionDeclarationFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\FunctionNotation\MethodArgumentSpaceFixer::class, [ + 'on_multiline' => 'ensure_fully_multiline', + ]); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\ControlStructure\NoUnneededControlParenthesesFixer::class, [ + 'statements' => [ + 'break', + 'clone', + 'continue', + 'echo_print', + 'return', + 'switch_case', + 'yield', + 'yield_from', + ], + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Whitespace\ArrayIndentationFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\AlignMultilineCommentFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocToCommentFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\LanguageConstruct\CombineConsecutiveUnsetsFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocIndentFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocAnnotationWithoutDotFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocTypesFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocScalarFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\Phpdoc\GeneralPhpdocTagRenameFixer::class, [ + 'replacements' => [ + 'inheritDocs' => 'inheritDoc', + ], + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocNoAliasTagFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocNoAccessFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocNoPackageFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocReturnSelfReferenceFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocAddMissingParamAnnotationFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Import\FullyQualifiedStrictTypesFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\Phpdoc\NoSuperfluousPhpdocTagsFixer::class, [ + 'allow_mixed' => true, + 'allow_unused_params' => true, + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocNoUselessInheritdocFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocNoEmptyReturnFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\FunctionNotation\LambdaNotUsedImportFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\NoEmptyPhpdocFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\FunctionNotation\NoTrailingCommaInSinglelineFunctionCallFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\LanguageConstruct\CombineConsecutiveIssetsFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Alias\BacktickToShellExecFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Comment\NoEmptyCommentFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Semicolon\SemicolonAfterInstructionFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\FunctionNotation\NoSpacesAfterFunctionNameFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Whitespace\NoSpacesInsideParenthesisFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ControlStructure\EmptyLoopConditionFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Import\NoUnneededImportAliasFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Comment\SingleLineCommentSpacingFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Operator\StandardizeIncrementFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\PhpTag\BlankLineAfterOpeningTagFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Import\SingleImportPerStatementFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\StringNotation\EscapeImplicitBackslashesFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Casing\ClassReferenceNameCasingFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\NamespaceNotation\CleanNamespaceFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Operator\ConcatSpaceFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\PhpTag\EchoTagSyntaxFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\FunctionNotation\FunctionTypehintSpaceFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ControlStructure\IncludeFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Operator\IncrementStyleFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Casing\IntegerLiteralCaseFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\PhpTag\LinebreakAfterOpeningTagFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Casing\MagicConstantCasingFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Casing\MagicMethodCasingFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Casing\NativeFunctionCasingFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Casing\NativeFunctionTypeDeclarationCasingFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Alias\NoAliasLanguageConstructCallFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\StringNotation\NoBinaryStringFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\NamespaceNotation\NoLeadingNamespaceWhitespaceFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Semicolon\NoSinglelineWhitespaceBeforeSemicolonsFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Whitespace\NoSpacesAroundOffsetFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ControlStructure\NoTrailingCommaInListCallFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ArrayNotation\NoTrailingCommaInSinglelineArrayFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\CastNotation\NoUnsetCastFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ArrayNotation\NoWhitespaceBeforeCommaInArrayFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ArrayNotation\NormalizeIndexBraceFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Operator\ObjectOperatorWithoutWhitespaceFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\PhpUnit\PhpUnitMethodCasingFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocInlineTagNormalizerFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocSummaryFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\Phpdoc\PhpdocTagTypeFixer::class, [ + 'tags' => [ + 'inheritDoc' => 'inline', + ], + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocTypesOrderFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocVarWithoutNameFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\StringNotation\SingleQuoteFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Operator\StandardizeNotEqualsFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ControlStructure\SwitchContinueToBreakFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ControlStructure\TrailingCommaInMultilineFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ArrayNotation\TrimArraySpacesFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Whitespace\TypesSpacesFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Operator\UnaryOperatorSpacesFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ArrayNotation\WhitespaceAfterCommaInArrayFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ControlStructure\YodaStyleFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Whitespace\CompactNullableTypehintFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\LanguageConstruct\DeclareEqualNormalizeFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\CastNotation\LowercaseCastFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Casing\LowercaseStaticReferenceFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ClassNotation\NoBlankLinesAfterClassOpeningFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\CastNotation\ShortScalarCastFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Operator\TernaryOperatorSpacesFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ClassNotation\VisibilityRequiredFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Casing\ConstantCaseFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Casing\LowercaseKeywordsFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ControlStructure\NoBreakCommentFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\PhpTag\NoClosingTagFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Operator\NoSpaceAroundDoubleColonFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Whitespace\NoTrailingWhitespaceFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Comment\NoTrailingWhitespaceInCommentFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ControlStructure\SwitchCaseSemicolonToColonFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ControlStructure\SwitchCaseSpaceFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\LanguageConstruct\ExplicitIndirectVariableFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\StringNotation\ExplicitStringVariableFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\StringNotation\HeredocToNowdocFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Comment\MultilineCommentOpeningClosingFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\Semicolon\MultilineWhitespaceBeforeSemicolonsFixer::class, [ + 'strategy' => 'new_line_for_chained_calls', + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ClassNotation\NoNullPropertyInitializationFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\Operator\OperatorLinebreakFixer::class, [ + 'only_booleans' => true, + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\PhpUnit\PhpUnitTestClassRequiresCoversFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocVarAnnotationCorrectOrderFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\Semicolon\SpaceAfterSemicolonFixer::class, [ + 'remove_in_empty_for_expressions' => true, + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocOrderFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocSeparationFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocTrimFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\CastNotation\NoShortBoolCastFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\PhpUnit\PhpUnitFqcnAnnotationFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\CastNotation\CastSpacesFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Alias\NoMixedEchoPrintFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Import\NoUnusedImportsFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocSingleLineVarSpacingFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocOrderByValueFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\StringNotation\SimpleToComplexStringVariableFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Import\SingleLineAfterImportsFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ReturnNotation\ReturnAssignmentFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\FunctionNotation\ReturnTypeDeclarationFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ReturnNotation\NoUselessReturnFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Whitespace\NoWhitespaceInBlankLineFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\NoBlankLinesAfterPhpdocFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\Whitespace\NoExtraBlankLinesFixer::class, [ + 'tokens' => [ + 'break', + 'case', + 'continue', + 'curly_brace_block', + 'default', + 'extra', + 'parenthesis_brace_block', + 'return', + 'square_brace_block', + 'switch', + 'throw', + 'use', + ], + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Import\NoLeadingImportSlashFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\NamespaceNotation\BlankLineAfterNamespaceFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\Whitespace\BlankLineBeforeStatementFixer::class, [ + 'statements' => [ + 'break', + 'case', + 'continue', + 'declare', + 'default', + 'exit', + 'goto', + 'include', + 'include_once', + 'phpdoc', + 'require', + 'require_once', + 'return', + 'switch', + 'throw', + 'try', + 'yield', + ], + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\NamespaceNotation\SingleBlankLineBeforeNamespaceFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Import\OrderedImportsFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Comment\SingleLineCommentStyleFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Operator\BinaryOperatorSpacesFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocTrimConsecutiveBlankLineSeparationFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocAlignFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Whitespace\SingleBlankLineAtEofFixer::class); }; diff --git a/config/set/php-cs-fixer/php54-migration.php b/config/set/php-cs-fixer/php54-migration.php index 3d4b1f4..3fcd48b 100644 --- a/config/set/php-cs-fixer/php54-migration.php +++ b/config/set/php-cs-fixer/php54-migration.php @@ -2,9 +2,8 @@ declare(strict_types=1); -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Symplify\EasyCodingStandard\Config\ECSConfig; -return static function (ContainerConfigurator $containerConfigurator): void { - $services = $containerConfigurator->services(); - $services->set(\PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer::class); +return static function (ECSConfig $containerConfigurator): void { + $containerConfigurator->rule(\PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer::class); }; diff --git a/config/set/php-cs-fixer/php56-migration-risky.php b/config/set/php-cs-fixer/php56-migration-risky.php index 0a28985..d7c8ea7 100644 --- a/config/set/php-cs-fixer/php56-migration-risky.php +++ b/config/set/php-cs-fixer/php56-migration-risky.php @@ -2,9 +2,8 @@ declare(strict_types=1); -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Symplify\EasyCodingStandard\Config\ECSConfig; -return static function (ContainerConfigurator $containerConfigurator): void { - $services = $containerConfigurator->services(); - $services->set(\PhpCsFixer\Fixer\Alias\PowToExponentiationFixer::class); +return static function (ECSConfig $containerConfigurator): void { + $containerConfigurator->rule(\PhpCsFixer\Fixer\Alias\PowToExponentiationFixer::class); }; diff --git a/config/set/php-cs-fixer/php70-migration-risky.php b/config/set/php-cs-fixer/php70-migration-risky.php index 9cc9803..4944fb8 100644 --- a/config/set/php-cs-fixer/php70-migration-risky.php +++ b/config/set/php-cs-fixer/php70-migration-risky.php @@ -2,21 +2,17 @@ declare(strict_types=1); -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Symplify\EasyCodingStandard\Config\ECSConfig; -return static function (ContainerConfigurator $containerConfigurator): void { - $services = $containerConfigurator->services(); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\CombineNestedDirnameFixer::class); - $services->set(\PhpCsFixer\Fixer\Alias\PowToExponentiationFixer::class); - $services->set(\PhpCsFixer\Fixer\Strict\DeclareStrictTypesFixer::class); - $services->set(\PhpCsFixer\Fixer\Basic\NonPrintableCharacterFixer::class); - $services->set(\PhpCsFixer\Fixer\Alias\RandomApiMigrationFixer::class) - ->call('configure', [ - [ - 'replacements' => [ - 'mt_rand' => 'random_int', - 'rand' => 'random_int', - ], - ], - ]); +return static function (ECSConfig $containerConfigurator): void { + $containerConfigurator->rule(\PhpCsFixer\Fixer\FunctionNotation\CombineNestedDirnameFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Alias\PowToExponentiationFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Strict\DeclareStrictTypesFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Basic\NonPrintableCharacterFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\Alias\RandomApiMigrationFixer::class, [ + 'replacements' => [ + 'mt_rand' => 'random_int', + 'rand' => 'random_int', + ], + ]); }; diff --git a/config/set/php-cs-fixer/php70-migration.php b/config/set/php-cs-fixer/php70-migration.php index 1b1c2ab..e5cec2d 100644 --- a/config/set/php-cs-fixer/php70-migration.php +++ b/config/set/php-cs-fixer/php70-migration.php @@ -2,10 +2,9 @@ declare(strict_types=1); -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Symplify\EasyCodingStandard\Config\ECSConfig; -return static function (ContainerConfigurator $containerConfigurator): void { - $services = $containerConfigurator->services(); - $services->set(\PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer::class); - $services->set(\PhpCsFixer\Fixer\Operator\TernaryToNullCoalescingFixer::class); +return static function (ECSConfig $containerConfigurator): void { + $containerConfigurator->rule(\PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Operator\TernaryToNullCoalescingFixer::class); }; diff --git a/config/set/php-cs-fixer/php71-migration-risky.php b/config/set/php-cs-fixer/php71-migration-risky.php index a828959..cef8bc0 100644 --- a/config/set/php-cs-fixer/php71-migration-risky.php +++ b/config/set/php-cs-fixer/php71-migration-risky.php @@ -2,22 +2,18 @@ declare(strict_types=1); -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Symplify\EasyCodingStandard\Config\ECSConfig; -return static function (ContainerConfigurator $containerConfigurator): void { - $services = $containerConfigurator->services(); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\CombineNestedDirnameFixer::class); - $services->set(\PhpCsFixer\Fixer\Alias\PowToExponentiationFixer::class); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\VoidReturnFixer::class); - $services->set(\PhpCsFixer\Fixer\Strict\DeclareStrictTypesFixer::class); - $services->set(\PhpCsFixer\Fixer\Basic\NonPrintableCharacterFixer::class); - $services->set(\PhpCsFixer\Fixer\Alias\RandomApiMigrationFixer::class) - ->call('configure', [ - [ - 'replacements' => [ - 'mt_rand' => 'random_int', - 'rand' => 'random_int', - ], - ], - ]); +return static function (ECSConfig $containerConfigurator): void { + $containerConfigurator->rule(\PhpCsFixer\Fixer\FunctionNotation\CombineNestedDirnameFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Alias\PowToExponentiationFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\FunctionNotation\VoidReturnFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Strict\DeclareStrictTypesFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Basic\NonPrintableCharacterFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\Alias\RandomApiMigrationFixer::class, [ + 'replacements' => [ + 'mt_rand' => 'random_int', + 'rand' => 'random_int', + ], + ]); }; diff --git a/config/set/php-cs-fixer/php71-migration.php b/config/set/php-cs-fixer/php71-migration.php index 2643158..3e66b46 100644 --- a/config/set/php-cs-fixer/php71-migration.php +++ b/config/set/php-cs-fixer/php71-migration.php @@ -2,12 +2,11 @@ declare(strict_types=1); -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Symplify\EasyCodingStandard\Config\ECSConfig; -return static function (ContainerConfigurator $containerConfigurator): void { - $services = $containerConfigurator->services(); - $services->set(\PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer::class); - $services->set(\PhpCsFixer\Fixer\ListNotation\ListSyntaxFixer::class); - $services->set(\PhpCsFixer\Fixer\Operator\TernaryToNullCoalescingFixer::class); - $services->set(\PhpCsFixer\Fixer\ClassNotation\VisibilityRequiredFixer::class); +return static function (ECSConfig $containerConfigurator): void { + $containerConfigurator->rule(\PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ListNotation\ListSyntaxFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Operator\TernaryToNullCoalescingFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ClassNotation\VisibilityRequiredFixer::class); }; diff --git a/config/set/php-cs-fixer/php73-migration.php b/config/set/php-cs-fixer/php73-migration.php index 7f58905..998e74f 100644 --- a/config/set/php-cs-fixer/php73-migration.php +++ b/config/set/php-cs-fixer/php73-migration.php @@ -2,31 +2,21 @@ declare(strict_types=1); -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Symplify\EasyCodingStandard\Config\ECSConfig; -return static function (ContainerConfigurator $containerConfigurator): void { - $services = $containerConfigurator->services(); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\MethodArgumentSpaceFixer::class) - ->call('configure', [ - [ - 'after_heredoc' => true, - ], - ]); - $services->set(\PhpCsFixer\Fixer\ListNotation\ListSyntaxFixer::class); - $services->set(\PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer::class); - $services->set(\PhpCsFixer\Fixer\ClassNotation\VisibilityRequiredFixer::class); - $services->set(\PhpCsFixer\Fixer\Operator\TernaryToNullCoalescingFixer::class); - $services->set(\PhpCsFixer\Fixer\Whitespace\HeredocIndentationFixer::class); - $services->set(\PhpCsFixer\Fixer\ArrayNotation\NoWhitespaceBeforeCommaInArrayFixer::class) - ->call('configure', [ - [ - 'after_heredoc' => true, - ], - ]); - $services->set(\PhpCsFixer\Fixer\ControlStructure\TrailingCommaInMultilineFixer::class) - ->call('configure', [ - [ - 'after_heredoc' => true, - ], - ]); +return static function (ECSConfig $containerConfigurator): void { + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\FunctionNotation\MethodArgumentSpaceFixer::class, [ + 'after_heredoc' => true, + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ListNotation\ListSyntaxFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ClassNotation\VisibilityRequiredFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Operator\TernaryToNullCoalescingFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Whitespace\HeredocIndentationFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\ArrayNotation\NoWhitespaceBeforeCommaInArrayFixer::class, [ + 'after_heredoc' => true, + ]); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\ControlStructure\TrailingCommaInMultilineFixer::class, [ + 'after_heredoc' => true, + ]); }; diff --git a/config/set/php-cs-fixer/php74-migration-risky.php b/config/set/php-cs-fixer/php74-migration-risky.php index 1ddd111..8545831 100644 --- a/config/set/php-cs-fixer/php74-migration-risky.php +++ b/config/set/php-cs-fixer/php74-migration-risky.php @@ -2,25 +2,21 @@ declare(strict_types=1); -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Symplify\EasyCodingStandard\Config\ECSConfig; -return static function (ContainerConfigurator $containerConfigurator): void { - $services = $containerConfigurator->services(); - $services->set(\PhpCsFixer\Fixer\Alias\NoAliasFunctionsFixer::class); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\ImplodeCallFixer::class); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\CombineNestedDirnameFixer::class); - $services->set(\PhpCsFixer\Fixer\Alias\PowToExponentiationFixer::class); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\VoidReturnFixer::class); - $services->set(\PhpCsFixer\Fixer\Strict\DeclareStrictTypesFixer::class); - $services->set(\PhpCsFixer\Fixer\Basic\NonPrintableCharacterFixer::class); - $services->set(\PhpCsFixer\Fixer\Alias\RandomApiMigrationFixer::class) - ->call('configure', [ - [ - 'replacements' => [ - 'mt_rand' => 'random_int', - 'rand' => 'random_int', - ], - ], - ]); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\UseArrowFunctionsFixer::class); +return static function (ECSConfig $containerConfigurator): void { + $containerConfigurator->rule(\PhpCsFixer\Fixer\Alias\NoAliasFunctionsFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\FunctionNotation\ImplodeCallFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\FunctionNotation\CombineNestedDirnameFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Alias\PowToExponentiationFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\FunctionNotation\VoidReturnFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Strict\DeclareStrictTypesFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Basic\NonPrintableCharacterFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\Alias\RandomApiMigrationFixer::class, [ + 'replacements' => [ + 'mt_rand' => 'random_int', + 'rand' => 'random_int', + ], + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\FunctionNotation\UseArrowFunctionsFixer::class); }; diff --git a/config/set/php-cs-fixer/php74-migration.php b/config/set/php-cs-fixer/php74-migration.php index 86ad3e7..5043bef 100644 --- a/config/set/php-cs-fixer/php74-migration.php +++ b/config/set/php-cs-fixer/php74-migration.php @@ -2,34 +2,24 @@ declare(strict_types=1); -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Symplify\EasyCodingStandard\Config\ECSConfig; -return static function (ContainerConfigurator $containerConfigurator): void { - $services = $containerConfigurator->services(); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\MethodArgumentSpaceFixer::class) - ->call('configure', [ - [ - 'after_heredoc' => true, - ], - ]); - $services->set(\PhpCsFixer\Fixer\ListNotation\ListSyntaxFixer::class); - $services->set(\PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer::class); - $services->set(\PhpCsFixer\Fixer\Whitespace\HeredocIndentationFixer::class); - $services->set(\PhpCsFixer\Fixer\ArrayNotation\NoWhitespaceBeforeCommaInArrayFixer::class) - ->call('configure', [ - [ - 'after_heredoc' => true, - ], - ]); - $services->set(\PhpCsFixer\Fixer\ControlStructure\TrailingCommaInMultilineFixer::class) - ->call('configure', [ - [ - 'after_heredoc' => true, - ], - ]); - $services->set(\PhpCsFixer\Fixer\ClassNotation\VisibilityRequiredFixer::class); - $services->set(\PhpCsFixer\Fixer\Operator\TernaryToNullCoalescingFixer::class); - $services->set(\PhpCsFixer\Fixer\ArrayNotation\NormalizeIndexBraceFixer::class); - $services->set(\PhpCsFixer\Fixer\CastNotation\ShortScalarCastFixer::class); - $services->set(\PhpCsFixer\Fixer\Operator\AssignNullCoalescingToCoalesceEqualFixer::class); +return static function (ECSConfig $containerConfigurator): void { + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\FunctionNotation\MethodArgumentSpaceFixer::class, [ + 'after_heredoc' => true, + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ListNotation\ListSyntaxFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Whitespace\HeredocIndentationFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\ArrayNotation\NoWhitespaceBeforeCommaInArrayFixer::class, [ + 'after_heredoc' => true, + ]); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\ControlStructure\TrailingCommaInMultilineFixer::class, [ + 'after_heredoc' => true, + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ClassNotation\VisibilityRequiredFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Operator\TernaryToNullCoalescingFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ArrayNotation\NormalizeIndexBraceFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\CastNotation\ShortScalarCastFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Operator\AssignNullCoalescingToCoalesceEqualFixer::class); }; diff --git a/config/set/php-cs-fixer/php80-migration-risky.php b/config/set/php-cs-fixer/php80-migration-risky.php index 51adad4..75275a4 100644 --- a/config/set/php-cs-fixer/php80-migration-risky.php +++ b/config/set/php-cs-fixer/php80-migration-risky.php @@ -2,35 +2,28 @@ declare(strict_types=1); -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Symplify\EasyCodingStandard\Config\ECSConfig; -return static function (ContainerConfigurator $containerConfigurator): void { - $services = $containerConfigurator->services(); - $services->set(\PhpCsFixer\Fixer\ClassNotation\NoPhp4ConstructorFixer::class); - $services->set(\PhpCsFixer\Fixer\Alias\NoAliasFunctionsFixer::class) - ->call('configure', [ - [ - 'sets' => ['@all'], - ], - ]); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\ImplodeCallFixer::class); - $services->set(\PhpCsFixer\Fixer\Alias\ModernizeStrposFixer::class); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\CombineNestedDirnameFixer::class); - $services->set(\PhpCsFixer\Fixer\Alias\PowToExponentiationFixer::class); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\VoidReturnFixer::class); - $services->set(\PhpCsFixer\Fixer\Strict\DeclareStrictTypesFixer::class); - $services->set(\PhpCsFixer\Fixer\LanguageConstruct\GetClassToClassKeywordFixer::class); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\UseArrowFunctionsFixer::class); - $services->set(\PhpCsFixer\Fixer\Basic\NonPrintableCharacterFixer::class); - $services->set(\PhpCsFixer\Fixer\Alias\RandomApiMigrationFixer::class) - ->call('configure', [ - [ - 'replacements' => [ - 'mt_rand' => 'random_int', - 'rand' => 'random_int', - ], - ], - ]); - $services->set(\PhpCsFixer\Fixer\ClassNotation\NoUnneededFinalMethodFixer::class); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\NoUnreachableDefaultArgumentValueFixer::class); +return static function (ECSConfig $containerConfigurator): void { + $containerConfigurator->rule(\PhpCsFixer\Fixer\ClassNotation\NoPhp4ConstructorFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\Alias\NoAliasFunctionsFixer::class, [ + 'sets' => ['@all'], + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\FunctionNotation\ImplodeCallFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Alias\ModernizeStrposFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\FunctionNotation\CombineNestedDirnameFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Alias\PowToExponentiationFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\FunctionNotation\VoidReturnFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Strict\DeclareStrictTypesFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\LanguageConstruct\GetClassToClassKeywordFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\FunctionNotation\UseArrowFunctionsFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Basic\NonPrintableCharacterFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\Alias\RandomApiMigrationFixer::class, [ + 'replacements' => [ + 'mt_rand' => 'random_int', + 'rand' => 'random_int', + ], + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ClassNotation\NoUnneededFinalMethodFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\FunctionNotation\NoUnreachableDefaultArgumentValueFixer::class); }; diff --git a/config/set/php-cs-fixer/php80-migration.php b/config/set/php-cs-fixer/php80-migration.php index fb21af5..4d946fd 100644 --- a/config/set/php-cs-fixer/php80-migration.php +++ b/config/set/php-cs-fixer/php80-migration.php @@ -2,36 +2,26 @@ declare(strict_types=1); -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Symplify\EasyCodingStandard\Config\ECSConfig; -return static function (ContainerConfigurator $containerConfigurator): void { - $services = $containerConfigurator->services(); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\MethodArgumentSpaceFixer::class) - ->call('configure', [ - [ - 'after_heredoc' => true, - ], - ]); - $services->set(\PhpCsFixer\Fixer\ListNotation\ListSyntaxFixer::class); - $services->set(\PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer::class); - $services->set(\PhpCsFixer\Fixer\ArrayNotation\NormalizeIndexBraceFixer::class); - $services->set(\PhpCsFixer\Fixer\CastNotation\ShortScalarCastFixer::class); - $services->set(\PhpCsFixer\Fixer\Whitespace\HeredocIndentationFixer::class); - $services->set(\PhpCsFixer\Fixer\ArrayNotation\NoWhitespaceBeforeCommaInArrayFixer::class) - ->call('configure', [ - [ - 'after_heredoc' => true, - ], - ]); - $services->set(\PhpCsFixer\Fixer\ControlStructure\TrailingCommaInMultilineFixer::class) - ->call('configure', [ - [ - 'after_heredoc' => true, - ], - ]); - $services->set(\PhpCsFixer\Fixer\ClassNotation\VisibilityRequiredFixer::class); - $services->set(\PhpCsFixer\Fixer\Operator\TernaryToNullCoalescingFixer::class); - $services->set(\PhpCsFixer\Fixer\NamespaceNotation\CleanNamespaceFixer::class); - $services->set(\PhpCsFixer\Fixer\CastNotation\NoUnsetCastFixer::class); - $services->set(\PhpCsFixer\Fixer\Operator\AssignNullCoalescingToCoalesceEqualFixer::class); +return static function (ECSConfig $containerConfigurator): void { + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\FunctionNotation\MethodArgumentSpaceFixer::class, [ + 'after_heredoc' => true, + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ListNotation\ListSyntaxFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ArrayNotation\NormalizeIndexBraceFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\CastNotation\ShortScalarCastFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Whitespace\HeredocIndentationFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\ArrayNotation\NoWhitespaceBeforeCommaInArrayFixer::class, [ + 'after_heredoc' => true, + ]); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\ControlStructure\TrailingCommaInMultilineFixer::class, [ + 'after_heredoc' => true, + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ClassNotation\VisibilityRequiredFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Operator\TernaryToNullCoalescingFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\NamespaceNotation\CleanNamespaceFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\CastNotation\NoUnsetCastFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Operator\AssignNullCoalescingToCoalesceEqualFixer::class); }; diff --git a/config/set/php-cs-fixer/php81-migration.php b/config/set/php-cs-fixer/php81-migration.php index a494880..d830b0a 100644 --- a/config/set/php-cs-fixer/php81-migration.php +++ b/config/set/php-cs-fixer/php81-migration.php @@ -2,37 +2,27 @@ declare(strict_types=1); -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Symplify\EasyCodingStandard\Config\ECSConfig; -return static function (ContainerConfigurator $containerConfigurator): void { - $services = $containerConfigurator->services(); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\MethodArgumentSpaceFixer::class) - ->call('configure', [ - [ - 'after_heredoc' => true, - ], - ]); - $services->set(\PhpCsFixer\Fixer\ListNotation\ListSyntaxFixer::class); - $services->set(\PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer::class); - $services->set(\PhpCsFixer\Fixer\NamespaceNotation\CleanNamespaceFixer::class); - $services->set(\PhpCsFixer\Fixer\CastNotation\NoUnsetCastFixer::class); - $services->set(\PhpCsFixer\Fixer\ArrayNotation\NormalizeIndexBraceFixer::class); - $services->set(\PhpCsFixer\Fixer\CastNotation\ShortScalarCastFixer::class); - $services->set(\PhpCsFixer\Fixer\Whitespace\HeredocIndentationFixer::class); - $services->set(\PhpCsFixer\Fixer\ArrayNotation\NoWhitespaceBeforeCommaInArrayFixer::class) - ->call('configure', [ - [ - 'after_heredoc' => true, - ], - ]); - $services->set(\PhpCsFixer\Fixer\ControlStructure\TrailingCommaInMultilineFixer::class) - ->call('configure', [ - [ - 'after_heredoc' => true, - ], - ]); - $services->set(\PhpCsFixer\Fixer\ClassNotation\VisibilityRequiredFixer::class); - $services->set(\PhpCsFixer\Fixer\Operator\TernaryToNullCoalescingFixer::class); - $services->set(\PhpCsFixer\Fixer\Basic\OctalNotationFixer::class); - $services->set(\PhpCsFixer\Fixer\Operator\AssignNullCoalescingToCoalesceEqualFixer::class); +return static function (ECSConfig $containerConfigurator): void { + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\FunctionNotation\MethodArgumentSpaceFixer::class, [ + 'after_heredoc' => true, + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ListNotation\ListSyntaxFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\NamespaceNotation\CleanNamespaceFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\CastNotation\NoUnsetCastFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ArrayNotation\NormalizeIndexBraceFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\CastNotation\ShortScalarCastFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Whitespace\HeredocIndentationFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\ArrayNotation\NoWhitespaceBeforeCommaInArrayFixer::class, [ + 'after_heredoc' => true, + ]); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\ControlStructure\TrailingCommaInMultilineFixer::class, [ + 'after_heredoc' => true, + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ClassNotation\VisibilityRequiredFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Operator\TernaryToNullCoalescingFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Basic\OctalNotationFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Operator\AssignNullCoalescingToCoalesceEqualFixer::class); }; diff --git a/config/set/php-cs-fixer/phpunit30-migration-risky.php b/config/set/php-cs-fixer/phpunit30-migration-risky.php index 847fa28..668127e 100644 --- a/config/set/php-cs-fixer/phpunit30-migration-risky.php +++ b/config/set/php-cs-fixer/phpunit30-migration-risky.php @@ -2,14 +2,10 @@ declare(strict_types=1); -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Symplify\EasyCodingStandard\Config\ECSConfig; -return static function (ContainerConfigurator $containerConfigurator): void { - $services = $containerConfigurator->services(); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitDedicateAssertFixer::class) - ->call('configure', [ - [ - 'target' => '3.0', - ], - ]); +return static function (ECSConfig $containerConfigurator): void { + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\PhpUnit\PhpUnitDedicateAssertFixer::class, [ + 'target' => '3.0', + ]); }; diff --git a/config/set/php-cs-fixer/phpunit32-migration-risky.php b/config/set/php-cs-fixer/phpunit32-migration-risky.php index c7ed2d3..7f0079d 100644 --- a/config/set/php-cs-fixer/phpunit32-migration-risky.php +++ b/config/set/php-cs-fixer/phpunit32-migration-risky.php @@ -2,20 +2,13 @@ declare(strict_types=1); -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Symplify\EasyCodingStandard\Config\ECSConfig; -return static function (ContainerConfigurator $containerConfigurator): void { - $services = $containerConfigurator->services(); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitNoExpectationAnnotationFixer::class) - ->call('configure', [ - [ - 'target' => '3.2', - ], - ]); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitDedicateAssertFixer::class) - ->call('configure', [ - [ - 'target' => '3.0', - ], - ]); +return static function (ECSConfig $containerConfigurator): void { + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\PhpUnit\PhpUnitNoExpectationAnnotationFixer::class, [ + 'target' => '3.2', + ]); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\PhpUnit\PhpUnitDedicateAssertFixer::class, [ + 'target' => '3.0', + ]); }; diff --git a/config/set/php-cs-fixer/phpunit35-migration-risky.php b/config/set/php-cs-fixer/phpunit35-migration-risky.php index a6c9fb4..4eb5786 100644 --- a/config/set/php-cs-fixer/phpunit35-migration-risky.php +++ b/config/set/php-cs-fixer/phpunit35-migration-risky.php @@ -2,20 +2,13 @@ declare(strict_types=1); -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Symplify\EasyCodingStandard\Config\ECSConfig; -return static function (ContainerConfigurator $containerConfigurator): void { - $services = $containerConfigurator->services(); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitNoExpectationAnnotationFixer::class) - ->call('configure', [ - [ - 'target' => '3.2', - ], - ]); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitDedicateAssertFixer::class) - ->call('configure', [ - [ - 'target' => '3.5', - ], - ]); +return static function (ECSConfig $containerConfigurator): void { + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\PhpUnit\PhpUnitNoExpectationAnnotationFixer::class, [ + 'target' => '3.2', + ]); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\PhpUnit\PhpUnitDedicateAssertFixer::class, [ + 'target' => '3.5', + ]); }; diff --git a/config/set/php-cs-fixer/phpunit43-migration-risky.php b/config/set/php-cs-fixer/phpunit43-migration-risky.php index d65cc8b..dbab678 100644 --- a/config/set/php-cs-fixer/phpunit43-migration-risky.php +++ b/config/set/php-cs-fixer/phpunit43-migration-risky.php @@ -2,20 +2,13 @@ declare(strict_types=1); -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Symplify\EasyCodingStandard\Config\ECSConfig; -return static function (ContainerConfigurator $containerConfigurator): void { - $services = $containerConfigurator->services(); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitNoExpectationAnnotationFixer::class) - ->call('configure', [ - [ - 'target' => '4.3', - ], - ]); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitDedicateAssertFixer::class) - ->call('configure', [ - [ - 'target' => '3.5', - ], - ]); +return static function (ECSConfig $containerConfigurator): void { + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\PhpUnit\PhpUnitNoExpectationAnnotationFixer::class, [ + 'target' => '4.3', + ]); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\PhpUnit\PhpUnitDedicateAssertFixer::class, [ + 'target' => '3.5', + ]); }; diff --git a/config/set/php-cs-fixer/phpunit48-migration-risky.php b/config/set/php-cs-fixer/phpunit48-migration-risky.php index 7042480..ab115c2 100644 --- a/config/set/php-cs-fixer/phpunit48-migration-risky.php +++ b/config/set/php-cs-fixer/phpunit48-migration-risky.php @@ -2,26 +2,16 @@ declare(strict_types=1); -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Symplify\EasyCodingStandard\Config\ECSConfig; -return static function (ContainerConfigurator $containerConfigurator): void { - $services = $containerConfigurator->services(); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitNoExpectationAnnotationFixer::class) - ->call('configure', [ - [ - 'target' => '4.3', - ], - ]); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitNamespacedFixer::class) - ->call('configure', [ - [ - 'target' => '4.8', - ], - ]); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitDedicateAssertFixer::class) - ->call('configure', [ - [ - 'target' => '3.5', - ], - ]); +return static function (ECSConfig $containerConfigurator): void { + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\PhpUnit\PhpUnitNoExpectationAnnotationFixer::class, [ + 'target' => '4.3', + ]); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\PhpUnit\PhpUnitNamespacedFixer::class, [ + 'target' => '4.8', + ]); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\PhpUnit\PhpUnitDedicateAssertFixer::class, [ + 'target' => '3.5', + ]); }; diff --git a/config/set/php-cs-fixer/phpunit50-migration-risky.php b/config/set/php-cs-fixer/phpunit50-migration-risky.php index 5e3d72b..3492b4b 100644 --- a/config/set/php-cs-fixer/phpunit50-migration-risky.php +++ b/config/set/php-cs-fixer/phpunit50-migration-risky.php @@ -2,26 +2,16 @@ declare(strict_types=1); -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Symplify\EasyCodingStandard\Config\ECSConfig; -return static function (ContainerConfigurator $containerConfigurator): void { - $services = $containerConfigurator->services(); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitNoExpectationAnnotationFixer::class) - ->call('configure', [ - [ - 'target' => '4.3', - ], - ]); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitNamespacedFixer::class) - ->call('configure', [ - [ - 'target' => '4.8', - ], - ]); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitDedicateAssertFixer::class) - ->call('configure', [ - [ - 'target' => '5.0', - ], - ]); +return static function (ECSConfig $containerConfigurator): void { + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\PhpUnit\PhpUnitNoExpectationAnnotationFixer::class, [ + 'target' => '4.3', + ]); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\PhpUnit\PhpUnitNamespacedFixer::class, [ + 'target' => '4.8', + ]); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\PhpUnit\PhpUnitDedicateAssertFixer::class, [ + 'target' => '5.0', + ]); }; diff --git a/config/set/php-cs-fixer/phpunit52-migration-risky.php b/config/set/php-cs-fixer/phpunit52-migration-risky.php index 4ab78e3..8d415bd 100644 --- a/config/set/php-cs-fixer/phpunit52-migration-risky.php +++ b/config/set/php-cs-fixer/phpunit52-migration-risky.php @@ -2,32 +2,19 @@ declare(strict_types=1); -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Symplify\EasyCodingStandard\Config\ECSConfig; -return static function (ContainerConfigurator $containerConfigurator): void { - $services = $containerConfigurator->services(); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitNoExpectationAnnotationFixer::class) - ->call('configure', [ - [ - 'target' => '4.3', - ], - ]); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitNamespacedFixer::class) - ->call('configure', [ - [ - 'target' => '4.8', - ], - ]); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitExpectationFixer::class) - ->call('configure', [ - [ - 'target' => '5.2', - ], - ]); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitDedicateAssertFixer::class) - ->call('configure', [ - [ - 'target' => '5.0', - ], - ]); +return static function (ECSConfig $containerConfigurator): void { + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\PhpUnit\PhpUnitNoExpectationAnnotationFixer::class, [ + 'target' => '4.3', + ]); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\PhpUnit\PhpUnitNamespacedFixer::class, [ + 'target' => '4.8', + ]); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\PhpUnit\PhpUnitExpectationFixer::class, [ + 'target' => '5.2', + ]); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\PhpUnit\PhpUnitDedicateAssertFixer::class, [ + 'target' => '5.0', + ]); }; diff --git a/config/set/php-cs-fixer/phpunit54-migration-risky.php b/config/set/php-cs-fixer/phpunit54-migration-risky.php index 836818d..593da40 100644 --- a/config/set/php-cs-fixer/phpunit54-migration-risky.php +++ b/config/set/php-cs-fixer/phpunit54-migration-risky.php @@ -2,38 +2,22 @@ declare(strict_types=1); -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Symplify\EasyCodingStandard\Config\ECSConfig; -return static function (ContainerConfigurator $containerConfigurator): void { - $services = $containerConfigurator->services(); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitNoExpectationAnnotationFixer::class) - ->call('configure', [ - [ - 'target' => '4.3', - ], - ]); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitExpectationFixer::class) - ->call('configure', [ - [ - 'target' => '5.2', - ], - ]); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitNamespacedFixer::class) - ->call('configure', [ - [ - 'target' => '4.8', - ], - ]); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitMockFixer::class) - ->call('configure', [ - [ - 'target' => '5.4', - ], - ]); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitDedicateAssertFixer::class) - ->call('configure', [ - [ - 'target' => '5.0', - ], - ]); +return static function (ECSConfig $containerConfigurator): void { + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\PhpUnit\PhpUnitNoExpectationAnnotationFixer::class, [ + 'target' => '4.3', + ]); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\PhpUnit\PhpUnitExpectationFixer::class, [ + 'target' => '5.2', + ]); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\PhpUnit\PhpUnitNamespacedFixer::class, [ + 'target' => '4.8', + ]); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\PhpUnit\PhpUnitMockFixer::class, [ + 'target' => '5.4', + ]); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\PhpUnit\PhpUnitDedicateAssertFixer::class, [ + 'target' => '5.0', + ]); }; diff --git a/config/set/php-cs-fixer/phpunit55-migration-risky.php b/config/set/php-cs-fixer/phpunit55-migration-risky.php index 3b1e784..fed52a9 100644 --- a/config/set/php-cs-fixer/phpunit55-migration-risky.php +++ b/config/set/php-cs-fixer/phpunit55-migration-risky.php @@ -2,38 +2,22 @@ declare(strict_types=1); -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Symplify\EasyCodingStandard\Config\ECSConfig; -return static function (ContainerConfigurator $containerConfigurator): void { - $services = $containerConfigurator->services(); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitNoExpectationAnnotationFixer::class) - ->call('configure', [ - [ - 'target' => '4.3', - ], - ]); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitMockFixer::class) - ->call('configure', [ - [ - 'target' => '5.5', - ], - ]); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitExpectationFixer::class) - ->call('configure', [ - [ - 'target' => '5.2', - ], - ]); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitNamespacedFixer::class) - ->call('configure', [ - [ - 'target' => '4.8', - ], - ]); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitDedicateAssertFixer::class) - ->call('configure', [ - [ - 'target' => '5.0', - ], - ]); +return static function (ECSConfig $containerConfigurator): void { + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\PhpUnit\PhpUnitNoExpectationAnnotationFixer::class, [ + 'target' => '4.3', + ]); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\PhpUnit\PhpUnitMockFixer::class, [ + 'target' => '5.5', + ]); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\PhpUnit\PhpUnitExpectationFixer::class, [ + 'target' => '5.2', + ]); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\PhpUnit\PhpUnitNamespacedFixer::class, [ + 'target' => '4.8', + ]); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\PhpUnit\PhpUnitDedicateAssertFixer::class, [ + 'target' => '5.0', + ]); }; diff --git a/config/set/php-cs-fixer/phpunit56-migration-risky.php b/config/set/php-cs-fixer/phpunit56-migration-risky.php index f54b198..19712ec 100644 --- a/config/set/php-cs-fixer/phpunit56-migration-risky.php +++ b/config/set/php-cs-fixer/phpunit56-migration-risky.php @@ -2,38 +2,22 @@ declare(strict_types=1); -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Symplify\EasyCodingStandard\Config\ECSConfig; -return static function (ContainerConfigurator $containerConfigurator): void { - $services = $containerConfigurator->services(); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitNoExpectationAnnotationFixer::class) - ->call('configure', [ - [ - 'target' => '4.3', - ], - ]); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitMockFixer::class) - ->call('configure', [ - [ - 'target' => '5.5', - ], - ]); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitExpectationFixer::class) - ->call('configure', [ - [ - 'target' => '5.6', - ], - ]); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitNamespacedFixer::class) - ->call('configure', [ - [ - 'target' => '4.8', - ], - ]); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitDedicateAssertFixer::class) - ->call('configure', [ - [ - 'target' => '5.6', - ], - ]); +return static function (ECSConfig $containerConfigurator): void { + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\PhpUnit\PhpUnitNoExpectationAnnotationFixer::class, [ + 'target' => '4.3', + ]); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\PhpUnit\PhpUnitMockFixer::class, [ + 'target' => '5.5', + ]); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\PhpUnit\PhpUnitExpectationFixer::class, [ + 'target' => '5.6', + ]); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\PhpUnit\PhpUnitNamespacedFixer::class, [ + 'target' => '4.8', + ]); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\PhpUnit\PhpUnitDedicateAssertFixer::class, [ + 'target' => '5.6', + ]); }; diff --git a/config/set/php-cs-fixer/phpunit57-migration-risky.php b/config/set/php-cs-fixer/phpunit57-migration-risky.php index 42ac418..0999674 100644 --- a/config/set/php-cs-fixer/phpunit57-migration-risky.php +++ b/config/set/php-cs-fixer/phpunit57-migration-risky.php @@ -2,38 +2,22 @@ declare(strict_types=1); -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Symplify\EasyCodingStandard\Config\ECSConfig; -return static function (ContainerConfigurator $containerConfigurator): void { - $services = $containerConfigurator->services(); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitNoExpectationAnnotationFixer::class) - ->call('configure', [ - [ - 'target' => '4.3', - ], - ]); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitExpectationFixer::class) - ->call('configure', [ - [ - 'target' => '5.6', - ], - ]); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitMockFixer::class) - ->call('configure', [ - [ - 'target' => '5.5', - ], - ]); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitNamespacedFixer::class) - ->call('configure', [ - [ - 'target' => '5.7', - ], - ]); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitDedicateAssertFixer::class) - ->call('configure', [ - [ - 'target' => '5.6', - ], - ]); +return static function (ECSConfig $containerConfigurator): void { + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\PhpUnit\PhpUnitNoExpectationAnnotationFixer::class, [ + 'target' => '4.3', + ]); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\PhpUnit\PhpUnitExpectationFixer::class, [ + 'target' => '5.6', + ]); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\PhpUnit\PhpUnitMockFixer::class, [ + 'target' => '5.5', + ]); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\PhpUnit\PhpUnitNamespacedFixer::class, [ + 'target' => '5.7', + ]); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\PhpUnit\PhpUnitDedicateAssertFixer::class, [ + 'target' => '5.6', + ]); }; diff --git a/config/set/php-cs-fixer/phpunit60-migration-risky.php b/config/set/php-cs-fixer/phpunit60-migration-risky.php index b337b69..1396376 100644 --- a/config/set/php-cs-fixer/phpunit60-migration-risky.php +++ b/config/set/php-cs-fixer/phpunit60-migration-risky.php @@ -2,38 +2,22 @@ declare(strict_types=1); -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Symplify\EasyCodingStandard\Config\ECSConfig; -return static function (ContainerConfigurator $containerConfigurator): void { - $services = $containerConfigurator->services(); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitNoExpectationAnnotationFixer::class) - ->call('configure', [ - [ - 'target' => '4.3', - ], - ]); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitNamespacedFixer::class) - ->call('configure', [ - [ - 'target' => '6.0', - ], - ]); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitExpectationFixer::class) - ->call('configure', [ - [ - 'target' => '5.6', - ], - ]); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitMockFixer::class) - ->call('configure', [ - [ - 'target' => '5.5', - ], - ]); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitDedicateAssertFixer::class) - ->call('configure', [ - [ - 'target' => '5.6', - ], - ]); +return static function (ECSConfig $containerConfigurator): void { + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\PhpUnit\PhpUnitNoExpectationAnnotationFixer::class, [ + 'target' => '4.3', + ]); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\PhpUnit\PhpUnitNamespacedFixer::class, [ + 'target' => '6.0', + ]); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\PhpUnit\PhpUnitExpectationFixer::class, [ + 'target' => '5.6', + ]); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\PhpUnit\PhpUnitMockFixer::class, [ + 'target' => '5.5', + ]); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\PhpUnit\PhpUnitDedicateAssertFixer::class, [ + 'target' => '5.6', + ]); }; diff --git a/config/set/php-cs-fixer/phpunit75-migration-risky.php b/config/set/php-cs-fixer/phpunit75-migration-risky.php index 2445e1e..e353863 100644 --- a/config/set/php-cs-fixer/phpunit75-migration-risky.php +++ b/config/set/php-cs-fixer/phpunit75-migration-risky.php @@ -2,44 +2,25 @@ declare(strict_types=1); -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Symplify\EasyCodingStandard\Config\ECSConfig; -return static function (ContainerConfigurator $containerConfigurator): void { - $services = $containerConfigurator->services(); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitNoExpectationAnnotationFixer::class) - ->call('configure', [ - [ - 'target' => '4.3', - ], - ]); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitNamespacedFixer::class) - ->call('configure', [ - [ - 'target' => '6.0', - ], - ]); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitExpectationFixer::class) - ->call('configure', [ - [ - 'target' => '5.6', - ], - ]); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitMockFixer::class) - ->call('configure', [ - [ - 'target' => '5.5', - ], - ]); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitDedicateAssertFixer::class) - ->call('configure', [ - [ - 'target' => '5.6', - ], - ]); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitDedicateAssertInternalTypeFixer::class) - ->call('configure', [ - [ - 'target' => '7.5', - ], - ]); +return static function (ECSConfig $containerConfigurator): void { + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\PhpUnit\PhpUnitNoExpectationAnnotationFixer::class, [ + 'target' => '4.3', + ]); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\PhpUnit\PhpUnitNamespacedFixer::class, [ + 'target' => '6.0', + ]); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\PhpUnit\PhpUnitExpectationFixer::class, [ + 'target' => '5.6', + ]); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\PhpUnit\PhpUnitMockFixer::class, [ + 'target' => '5.5', + ]); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\PhpUnit\PhpUnitDedicateAssertFixer::class, [ + 'target' => '5.6', + ]); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\PhpUnit\PhpUnitDedicateAssertInternalTypeFixer::class, [ + 'target' => '7.5', + ]); }; diff --git a/config/set/php-cs-fixer/phpunit84-migration-risky.php b/config/set/php-cs-fixer/phpunit84-migration-risky.php index cd8d684..5b22015 100644 --- a/config/set/php-cs-fixer/phpunit84-migration-risky.php +++ b/config/set/php-cs-fixer/phpunit84-migration-risky.php @@ -2,44 +2,25 @@ declare(strict_types=1); -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Symplify\EasyCodingStandard\Config\ECSConfig; -return static function (ContainerConfigurator $containerConfigurator): void { - $services = $containerConfigurator->services(); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitNoExpectationAnnotationFixer::class) - ->call('configure', [ - [ - 'target' => '4.3', - ], - ]); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitNamespacedFixer::class) - ->call('configure', [ - [ - 'target' => '6.0', - ], - ]); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitExpectationFixer::class) - ->call('configure', [ - [ - 'target' => '8.4', - ], - ]); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitMockFixer::class) - ->call('configure', [ - [ - 'target' => '5.5', - ], - ]); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitDedicateAssertFixer::class) - ->call('configure', [ - [ - 'target' => '5.6', - ], - ]); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitDedicateAssertInternalTypeFixer::class) - ->call('configure', [ - [ - 'target' => '7.5', - ], - ]); +return static function (ECSConfig $containerConfigurator): void { + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\PhpUnit\PhpUnitNoExpectationAnnotationFixer::class, [ + 'target' => '4.3', + ]); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\PhpUnit\PhpUnitNamespacedFixer::class, [ + 'target' => '6.0', + ]); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\PhpUnit\PhpUnitExpectationFixer::class, [ + 'target' => '8.4', + ]); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\PhpUnit\PhpUnitMockFixer::class, [ + 'target' => '5.5', + ]); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\PhpUnit\PhpUnitDedicateAssertFixer::class, [ + 'target' => '5.6', + ]); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\PhpUnit\PhpUnitDedicateAssertInternalTypeFixer::class, [ + 'target' => '7.5', + ]); }; diff --git a/config/set/php-cs-fixer/psr1.php b/config/set/php-cs-fixer/psr1.php index 22aa1eb..fa5e82f 100644 --- a/config/set/php-cs-fixer/psr1.php +++ b/config/set/php-cs-fixer/psr1.php @@ -2,10 +2,9 @@ declare(strict_types=1); -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Symplify\EasyCodingStandard\Config\ECSConfig; -return static function (ContainerConfigurator $containerConfigurator): void { - $services = $containerConfigurator->services(); - $services->set(\PhpCsFixer\Fixer\Basic\EncodingFixer::class); - $services->set(\PhpCsFixer\Fixer\PhpTag\FullOpeningTagFixer::class); +return static function (ECSConfig $containerConfigurator): void { + $containerConfigurator->rule(\PhpCsFixer\Fixer\Basic\EncodingFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\PhpTag\FullOpeningTagFixer::class); }; diff --git a/config/set/php-cs-fixer/psr12-risky.php b/config/set/php-cs-fixer/psr12-risky.php index 00b9398..0fc0778 100644 --- a/config/set/php-cs-fixer/psr12-risky.php +++ b/config/set/php-cs-fixer/psr12-risky.php @@ -2,10 +2,9 @@ declare(strict_types=1); -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Symplify\EasyCodingStandard\Config\ECSConfig; -return static function (ContainerConfigurator $containerConfigurator): void { - $services = $containerConfigurator->services(); - $services->set(\PhpCsFixer\Fixer\StringNotation\NoTrailingWhitespaceInStringFixer::class); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\NoUnreachableDefaultArgumentValueFixer::class); +return static function (ECSConfig $containerConfigurator): void { + $containerConfigurator->rule(\PhpCsFixer\Fixer\StringNotation\NoTrailingWhitespaceInStringFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\FunctionNotation\NoUnreachableDefaultArgumentValueFixer::class); }; diff --git a/config/set/php-cs-fixer/psr12.php b/config/set/php-cs-fixer/psr12.php index f886e94..b2eec17 100644 --- a/config/set/php-cs-fixer/psr12.php +++ b/config/set/php-cs-fixer/psr12.php @@ -2,82 +2,63 @@ declare(strict_types=1); -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Symplify\EasyCodingStandard\Config\ECSConfig; -return static function (ContainerConfigurator $containerConfigurator): void { - $services = $containerConfigurator->services(); - $services->set(\PhpCsFixer\Fixer\Basic\EncodingFixer::class); - $services->set(\PhpCsFixer\Fixer\PhpTag\FullOpeningTagFixer::class); - $services->set(\PhpCsFixer\Fixer\ClassNotation\OrderedClassElementsFixer::class) - ->call('configure', [ - [ - 'order' => ['use_trait'], - ], - ]); - $services->set(\PhpCsFixer\Fixer\ClassNotation\SingleClassElementPerStatementFixer::class) - ->call('configure', [ - [ - 'elements' => ['property'], - ], - ]); - $services->set(\PhpCsFixer\Fixer\Whitespace\IndentationTypeFixer::class); - $services->set(\PhpCsFixer\Fixer\ControlStructure\ElseifFixer::class); - $services->set(\PhpCsFixer\Fixer\Whitespace\LineEndingFixer::class); - $services->set(\PhpCsFixer\Fixer\Operator\NewWithBracesFixer::class); - $services->set(\PhpCsFixer\Fixer\ClassNotation\ClassDefinitionFixer::class) - ->call('configure', [ - [ - 'inline_constructor_arguments' => false, - 'space_before_parenthesis' => true, - ], - ]); - $services->set(\PhpCsFixer\Fixer\ClassNotation\SingleTraitInsertPerStatementFixer::class); - $services->set(\PhpCsFixer\Fixer\Basic\BracesFixer::class) - ->call('configure', [ - [ - 'allow_single_line_anonymous_class_with_empty_body' => true, - ], - ]); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\FunctionDeclarationFixer::class); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\MethodArgumentSpaceFixer::class) - ->call('configure', [ - [ - 'on_multiline' => 'ensure_fully_multiline', - ], - ]); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\NoSpacesAfterFunctionNameFixer::class); - $services->set(\PhpCsFixer\Fixer\Whitespace\NoSpacesInsideParenthesisFixer::class); - $services->set(\PhpCsFixer\Fixer\Import\SingleImportPerStatementFixer::class); - $services->set(\PhpCsFixer\Fixer\PhpTag\BlankLineAfterOpeningTagFixer::class); - $services->set(\PhpCsFixer\Fixer\Casing\ConstantCaseFixer::class); - $services->set(\PhpCsFixer\Fixer\Casing\LowercaseKeywordsFixer::class); - $services->set(\PhpCsFixer\Fixer\ControlStructure\NoBreakCommentFixer::class); - $services->set(\PhpCsFixer\Fixer\PhpTag\NoClosingTagFixer::class); - $services->set(\PhpCsFixer\Fixer\Operator\NoSpaceAroundDoubleColonFixer::class); - $services->set(\PhpCsFixer\Fixer\Whitespace\NoTrailingWhitespaceFixer::class); - $services->set(\PhpCsFixer\Fixer\Comment\NoTrailingWhitespaceInCommentFixer::class); - $services->set(\PhpCsFixer\Fixer\ControlStructure\SwitchCaseSemicolonToColonFixer::class); - $services->set(\PhpCsFixer\Fixer\ControlStructure\SwitchCaseSpaceFixer::class); - $services->set(\PhpCsFixer\Fixer\ClassNotation\VisibilityRequiredFixer::class); - $services->set(\PhpCsFixer\Fixer\Whitespace\CompactNullableTypehintFixer::class); - $services->set(\PhpCsFixer\Fixer\LanguageConstruct\DeclareEqualNormalizeFixer::class); - $services->set(\PhpCsFixer\Fixer\CastNotation\LowercaseCastFixer::class); - $services->set(\PhpCsFixer\Fixer\Casing\LowercaseStaticReferenceFixer::class); - $services->set(\PhpCsFixer\Fixer\ClassNotation\NoBlankLinesAfterClassOpeningFixer::class); - $services->set(\PhpCsFixer\Fixer\CastNotation\ShortScalarCastFixer::class); - $services->set(\PhpCsFixer\Fixer\Operator\TernaryOperatorSpacesFixer::class); - $services->set(\PhpCsFixer\Fixer\Import\SingleLineAfterImportsFixer::class); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\ReturnTypeDeclarationFixer::class); - $services->set(\PhpCsFixer\Fixer\Whitespace\NoWhitespaceInBlankLineFixer::class); - $services->set(\PhpCsFixer\Fixer\NamespaceNotation\BlankLineAfterNamespaceFixer::class); - $services->set(\PhpCsFixer\Fixer\Import\NoLeadingImportSlashFixer::class); - $services->set(\PhpCsFixer\Fixer\NamespaceNotation\SingleBlankLineBeforeNamespaceFixer::class); - $services->set(\PhpCsFixer\Fixer\Import\OrderedImportsFixer::class) - ->call('configure', [ - [ - 'imports_order' => ['class', 'function', 'const'], - 'sort_algorithm' => 'none', - ], - ]); - $services->set(\PhpCsFixer\Fixer\Whitespace\SingleBlankLineAtEofFixer::class); +return static function (ECSConfig $containerConfigurator): void { + $containerConfigurator->rule(\PhpCsFixer\Fixer\Basic\EncodingFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\PhpTag\FullOpeningTagFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\ClassNotation\OrderedClassElementsFixer::class, [ + 'order' => ['use_trait'], + ]); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\ClassNotation\SingleClassElementPerStatementFixer::class, [ + 'elements' => ['property'], + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Whitespace\IndentationTypeFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ControlStructure\ElseifFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Whitespace\LineEndingFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Operator\NewWithBracesFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\ClassNotation\ClassDefinitionFixer::class, [ + 'inline_constructor_arguments' => false, + 'space_before_parenthesis' => true, + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ClassNotation\SingleTraitInsertPerStatementFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\Basic\BracesFixer::class, [ + 'allow_single_line_anonymous_class_with_empty_body' => true, + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\FunctionNotation\FunctionDeclarationFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\FunctionNotation\MethodArgumentSpaceFixer::class, [ + 'on_multiline' => 'ensure_fully_multiline', + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\FunctionNotation\NoSpacesAfterFunctionNameFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Whitespace\NoSpacesInsideParenthesisFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Import\SingleImportPerStatementFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\PhpTag\BlankLineAfterOpeningTagFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Casing\ConstantCaseFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Casing\LowercaseKeywordsFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ControlStructure\NoBreakCommentFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\PhpTag\NoClosingTagFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Operator\NoSpaceAroundDoubleColonFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Whitespace\NoTrailingWhitespaceFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Comment\NoTrailingWhitespaceInCommentFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ControlStructure\SwitchCaseSemicolonToColonFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ControlStructure\SwitchCaseSpaceFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ClassNotation\VisibilityRequiredFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Whitespace\CompactNullableTypehintFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\LanguageConstruct\DeclareEqualNormalizeFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\CastNotation\LowercaseCastFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Casing\LowercaseStaticReferenceFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ClassNotation\NoBlankLinesAfterClassOpeningFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\CastNotation\ShortScalarCastFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Operator\TernaryOperatorSpacesFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Import\SingleLineAfterImportsFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\FunctionNotation\ReturnTypeDeclarationFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Whitespace\NoWhitespaceInBlankLineFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\NamespaceNotation\BlankLineAfterNamespaceFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Import\NoLeadingImportSlashFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\NamespaceNotation\SingleBlankLineBeforeNamespaceFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\Import\OrderedImportsFixer::class, [ + 'imports_order' => ['class', 'function', 'const'], + 'sort_algorithm' => 'none', + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Whitespace\SingleBlankLineAtEofFixer::class); }; diff --git a/config/set/php-cs-fixer/psr2.php b/config/set/php-cs-fixer/psr2.php index 37c2df2..f23cb7a 100644 --- a/config/set/php-cs-fixer/psr2.php +++ b/config/set/php-cs-fixer/psr2.php @@ -2,49 +2,39 @@ declare(strict_types=1); -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Symplify\EasyCodingStandard\Config\ECSConfig; -return static function (ContainerConfigurator $containerConfigurator): void { - $services = $containerConfigurator->services(); - $services->set(\PhpCsFixer\Fixer\Basic\EncodingFixer::class); - $services->set(\PhpCsFixer\Fixer\PhpTag\FullOpeningTagFixer::class); - $services->set(\PhpCsFixer\Fixer\ClassNotation\SingleClassElementPerStatementFixer::class) - ->call('configure', [ - [ - 'elements' => ['property'], - ], - ]); - $services->set(\PhpCsFixer\Fixer\Whitespace\IndentationTypeFixer::class); - $services->set(\PhpCsFixer\Fixer\ControlStructure\ElseifFixer::class); - $services->set(\PhpCsFixer\Fixer\Whitespace\LineEndingFixer::class); - $services->set(\PhpCsFixer\Fixer\ClassNotation\ClassDefinitionFixer::class); - $services->set(\PhpCsFixer\Fixer\Basic\BracesFixer::class); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\FunctionDeclarationFixer::class); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\MethodArgumentSpaceFixer::class) - ->call('configure', [ - [ - 'on_multiline' => 'ensure_fully_multiline', - ], - ]); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\NoSpacesAfterFunctionNameFixer::class); - $services->set(\PhpCsFixer\Fixer\Whitespace\NoSpacesInsideParenthesisFixer::class); - $services->set(\PhpCsFixer\Fixer\Import\SingleImportPerStatementFixer::class); - $services->set(\PhpCsFixer\Fixer\Casing\ConstantCaseFixer::class); - $services->set(\PhpCsFixer\Fixer\Casing\LowercaseKeywordsFixer::class); - $services->set(\PhpCsFixer\Fixer\ControlStructure\NoBreakCommentFixer::class); - $services->set(\PhpCsFixer\Fixer\PhpTag\NoClosingTagFixer::class); - $services->set(\PhpCsFixer\Fixer\Operator\NoSpaceAroundDoubleColonFixer::class); - $services->set(\PhpCsFixer\Fixer\Whitespace\NoTrailingWhitespaceFixer::class); - $services->set(\PhpCsFixer\Fixer\Comment\NoTrailingWhitespaceInCommentFixer::class); - $services->set(\PhpCsFixer\Fixer\ControlStructure\SwitchCaseSemicolonToColonFixer::class); - $services->set(\PhpCsFixer\Fixer\ControlStructure\SwitchCaseSpaceFixer::class); - $services->set(\PhpCsFixer\Fixer\ClassNotation\VisibilityRequiredFixer::class) - ->call('configure', [ - [ - 'elements' => ['method', 'property'], - ], - ]); - $services->set(\PhpCsFixer\Fixer\Import\SingleLineAfterImportsFixer::class); - $services->set(\PhpCsFixer\Fixer\NamespaceNotation\BlankLineAfterNamespaceFixer::class); - $services->set(\PhpCsFixer\Fixer\Whitespace\SingleBlankLineAtEofFixer::class); +return static function (ECSConfig $containerConfigurator): void { + $containerConfigurator->rule(\PhpCsFixer\Fixer\Basic\EncodingFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\PhpTag\FullOpeningTagFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\ClassNotation\SingleClassElementPerStatementFixer::class, [ + 'elements' => ['property'], + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Whitespace\IndentationTypeFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ControlStructure\ElseifFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Whitespace\LineEndingFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ClassNotation\ClassDefinitionFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Basic\BracesFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\FunctionNotation\FunctionDeclarationFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\FunctionNotation\MethodArgumentSpaceFixer::class, [ + 'on_multiline' => 'ensure_fully_multiline', + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\FunctionNotation\NoSpacesAfterFunctionNameFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Whitespace\NoSpacesInsideParenthesisFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Import\SingleImportPerStatementFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Casing\ConstantCaseFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Casing\LowercaseKeywordsFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ControlStructure\NoBreakCommentFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\PhpTag\NoClosingTagFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Operator\NoSpaceAroundDoubleColonFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Whitespace\NoTrailingWhitespaceFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Comment\NoTrailingWhitespaceInCommentFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ControlStructure\SwitchCaseSemicolonToColonFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ControlStructure\SwitchCaseSpaceFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\ClassNotation\VisibilityRequiredFixer::class, [ + 'elements' => ['method', 'property'], + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Import\SingleLineAfterImportsFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\NamespaceNotation\BlankLineAfterNamespaceFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Whitespace\SingleBlankLineAtEofFixer::class); }; diff --git a/config/set/php-cs-fixer/symfony-risky.php b/config/set/php-cs-fixer/symfony-risky.php index cb8c50d..08a9392 100644 --- a/config/set/php-cs-fixer/symfony-risky.php +++ b/config/set/php-cs-fixer/symfony-risky.php @@ -2,53 +2,46 @@ declare(strict_types=1); -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Symplify\EasyCodingStandard\Config\ECSConfig; -return static function (ContainerConfigurator $containerConfigurator): void { - $services = $containerConfigurator->services(); - $services->set(\PhpCsFixer\Fixer\ClassNotation\NoPhp4ConstructorFixer::class); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\NoUselessSprintfFixer::class); - $services->set(\PhpCsFixer\Fixer\LanguageConstruct\DirConstantFixer::class); - $services->set(\PhpCsFixer\Fixer\Alias\NoAliasFunctionsFixer::class); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\ImplodeCallFixer::class); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\CombineNestedDirnameFixer::class); - $services->set(\PhpCsFixer\Fixer\Alias\PowToExponentiationFixer::class); - $services->set(\PhpCsFixer\Fixer\ConstantNotation\NativeConstantInvocationFixer::class); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitTestAnnotationFixer::class); - $services->set(\PhpCsFixer\Fixer\LanguageConstruct\FunctionToConstantFixer::class); - $services->set(\PhpCsFixer\Fixer\LanguageConstruct\IsNullFixer::class); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\NativeFunctionInvocationFixer::class) - ->call('configure', [ - [ - 'include' => ['@compiler_optimized'], - 'scope' => 'namespaced', - 'strict' => true, - ], - ]); - $services->set(\PhpCsFixer\Fixer\StringNotation\StringLengthToEmptyFixer::class); - $services->set(\PhpCsFixer\Fixer\Operator\TernaryToElvisOperatorFixer::class); - $services->set(\PhpCsFixer\Fixer\StringNotation\NoTrailingWhitespaceInStringFixer::class); - $services->set(\PhpCsFixer\Fixer\Alias\ArrayPushFixer::class); - $services->set(\PhpCsFixer\Fixer\Alias\EregToPregFixer::class); - $services->set(\PhpCsFixer\Fixer\LanguageConstruct\ErrorSuppressionFixer::class); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\FopenFlagOrderFixer::class); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\FopenFlagsFixer::class) - ->call('configure', [ - [ - 'b_mode' => false, - ], - ]); - $services->set(\PhpCsFixer\Fixer\Operator\LogicalOperatorsFixer::class); - $services->set(\PhpCsFixer\Fixer\CastNotation\ModernizeTypesCastingFixer::class); - $services->set(\PhpCsFixer\Fixer\Naming\NoHomoglyphNamesFixer::class); - $services->set(\PhpCsFixer\Fixer\ClassNotation\NoUnneededFinalMethodFixer::class); - $services->set(\PhpCsFixer\Fixer\Basic\NonPrintableCharacterFixer::class); - $services->set(\PhpCsFixer\Fixer\ClassNotation\OrderedTraitsFixer::class); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitMockShortWillReturnFixer::class); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitSetUpTearDownVisibilityFixer::class); - $services->set(\PhpCsFixer\Fixer\ClassNotation\SelfAccessorFixer::class); - $services->set(\PhpCsFixer\Fixer\Alias\SetTypeToCastFixer::class); - $services->set(\PhpCsFixer\Fixer\StringNotation\StringLineEndingFixer::class); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitConstructFixer::class); - $services->set(\PhpCsFixer\Fixer\Basic\PsrAutoloadingFixer::class); +return static function (ECSConfig $containerConfigurator): void { + $containerConfigurator->rule(\PhpCsFixer\Fixer\ClassNotation\NoPhp4ConstructorFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\FunctionNotation\NoUselessSprintfFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\LanguageConstruct\DirConstantFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Alias\NoAliasFunctionsFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\FunctionNotation\ImplodeCallFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\FunctionNotation\CombineNestedDirnameFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Alias\PowToExponentiationFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ConstantNotation\NativeConstantInvocationFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\PhpUnit\PhpUnitTestAnnotationFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\LanguageConstruct\FunctionToConstantFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\LanguageConstruct\IsNullFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\FunctionNotation\NativeFunctionInvocationFixer::class, [ + 'include' => ['@compiler_optimized'], + 'scope' => 'namespaced', + 'strict' => true, + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\StringNotation\StringLengthToEmptyFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Operator\TernaryToElvisOperatorFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\StringNotation\NoTrailingWhitespaceInStringFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Alias\ArrayPushFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Alias\EregToPregFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\LanguageConstruct\ErrorSuppressionFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\FunctionNotation\FopenFlagOrderFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\FunctionNotation\FopenFlagsFixer::class, [ + 'b_mode' => false, + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Operator\LogicalOperatorsFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\CastNotation\ModernizeTypesCastingFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Naming\NoHomoglyphNamesFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ClassNotation\NoUnneededFinalMethodFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Basic\NonPrintableCharacterFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ClassNotation\OrderedTraitsFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\PhpUnit\PhpUnitMockShortWillReturnFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\PhpUnit\PhpUnitSetUpTearDownVisibilityFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ClassNotation\SelfAccessorFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Alias\SetTypeToCastFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\StringNotation\StringLineEndingFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\PhpUnit\PhpUnitConstructFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Basic\PsrAutoloadingFixer::class); }; diff --git a/config/set/php-cs-fixer/symfony.php b/config/set/php-cs-fixer/symfony.php index 573aff4..58cb8bc 100644 --- a/config/set/php-cs-fixer/symfony.php +++ b/config/set/php-cs-fixer/symfony.php @@ -2,248 +2,199 @@ declare(strict_types=1); -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Symplify\EasyCodingStandard\Config\ECSConfig; -return static function (ContainerConfigurator $containerConfigurator): void { - $services = $containerConfigurator->services(); - $services->set(\PhpCsFixer\Fixer\Basic\EncodingFixer::class); - $services->set(\PhpCsFixer\Fixer\PhpTag\FullOpeningTagFixer::class); - $services->set(\PhpCsFixer\Fixer\ClassNotation\ProtectedToPrivateFixer::class); - $services->set(\PhpCsFixer\Fixer\ClassNotation\OrderedClassElementsFixer::class) - ->call('configure', [ - [ - 'order' => ['use_trait'], - ], - ]); - $services->set(\PhpCsFixer\Fixer\ClassNotation\SingleClassElementPerStatementFixer::class); - $services->set(\PhpCsFixer\Fixer\ClassNotation\ClassAttributesSeparationFixer::class) - ->call('configure', [ - [ - 'elements' => [ - 'method' => 'one', - ], - ], - ]); - $services->set(\PhpCsFixer\Fixer\Whitespace\IndentationTypeFixer::class); - $services->set(\PhpCsFixer\Fixer\ControlStructure\NoAlternativeSyntaxFixer::class); - $services->set(\PhpCsFixer\Fixer\ControlStructure\ElseifFixer::class); - $services->set(\PhpCsFixer\Fixer\Whitespace\LineEndingFixer::class); - $services->set(\PhpCsFixer\Fixer\Semicolon\NoEmptyStatementFixer::class); - $services->set(\PhpCsFixer\Fixer\ControlStructure\NoUnneededCurlyBracesFixer::class) - ->call('configure', [ - [ - 'namespaces' => true, - ], - ]); - $services->set(\PhpCsFixer\Fixer\ControlStructure\EmptyLoopBodyFixer::class) - ->call('configure', [ - [ - 'style' => 'braces', - ], - ]); - $services->set(\PhpCsFixer\Fixer\Operator\NewWithBracesFixer::class); - $services->set(\PhpCsFixer\Fixer\ClassNotation\ClassDefinitionFixer::class) - ->call('configure', [ - [ - 'single_line' => true, - ], - ]); - $services->set(\PhpCsFixer\Fixer\ClassNotation\SingleTraitInsertPerStatementFixer::class); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\SingleLineThrowFixer::class); - $services->set(\PhpCsFixer\Fixer\LanguageConstruct\SingleSpaceAfterConstructFixer::class); - $services->set(\PhpCsFixer\Fixer\Basic\BracesFixer::class) - ->call('configure', [ - [ - 'allow_single_line_anonymous_class_with_empty_body' => true, - 'allow_single_line_closure' => true, - ], - ]); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\FunctionDeclarationFixer::class); - $services->set(\PhpCsFixer\Fixer\ArrayNotation\NoMultilineWhitespaceAroundDoubleArrowFixer::class); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\MethodArgumentSpaceFixer::class) - ->call('configure', [ - [ - 'on_multiline' => 'ignore', - ], - ]); - $services->set(\PhpCsFixer\Fixer\ControlStructure\NoUnneededControlParenthesesFixer::class) - ->call('configure', [ - [ - 'statements' => [ - 'break', - 'clone', - 'continue', - 'echo_print', - 'return', - 'switch_case', - 'yield', - 'yield_from', - ], - ], - ]); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocToCommentFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocIndentFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocAnnotationWithoutDotFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocTypesFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocScalarFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\GeneralPhpdocTagRenameFixer::class) - ->call('configure', [ - [ - 'replacements' => [ - 'inheritDocs' => 'inheritDoc', - ], - ], - ]); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocNoAliasTagFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocNoAccessFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocNoPackageFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocReturnSelfReferenceFixer::class); - $services->set(\PhpCsFixer\Fixer\Import\FullyQualifiedStrictTypesFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\NoSuperfluousPhpdocTagsFixer::class) - ->call('configure', [ - [ - 'allow_mixed' => true, - 'allow_unused_params' => true, - ], - ]); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocNoUselessInheritdocFixer::class); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\LambdaNotUsedImportFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\NoEmptyPhpdocFixer::class); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\NoTrailingCommaInSinglelineFunctionCallFixer::class); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\NoSpacesAfterFunctionNameFixer::class); - $services->set(\PhpCsFixer\Fixer\Whitespace\NoSpacesInsideParenthesisFixer::class); - $services->set(\PhpCsFixer\Fixer\Alias\BacktickToShellExecFixer::class); - $services->set(\PhpCsFixer\Fixer\Comment\NoEmptyCommentFixer::class); - $services->set(\PhpCsFixer\Fixer\Semicolon\SemicolonAfterInstructionFixer::class); - $services->set(\PhpCsFixer\Fixer\PhpTag\BlankLineAfterOpeningTagFixer::class); - $services->set(\PhpCsFixer\Fixer\Import\SingleImportPerStatementFixer::class); - $services->set(\PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer::class); - $services->set(\PhpCsFixer\Fixer\ControlStructure\EmptyLoopConditionFixer::class); - $services->set(\PhpCsFixer\Fixer\Import\NoUnneededImportAliasFixer::class); - $services->set(\PhpCsFixer\Fixer\Comment\SingleLineCommentSpacingFixer::class); - $services->set(\PhpCsFixer\Fixer\Operator\StandardizeIncrementFixer::class); - $services->set(\PhpCsFixer\Fixer\Whitespace\CompactNullableTypehintFixer::class); - $services->set(\PhpCsFixer\Fixer\LanguageConstruct\DeclareEqualNormalizeFixer::class); - $services->set(\PhpCsFixer\Fixer\CastNotation\LowercaseCastFixer::class); - $services->set(\PhpCsFixer\Fixer\Casing\LowercaseStaticReferenceFixer::class); - $services->set(\PhpCsFixer\Fixer\ClassNotation\NoBlankLinesAfterClassOpeningFixer::class); - $services->set(\PhpCsFixer\Fixer\CastNotation\ShortScalarCastFixer::class); - $services->set(\PhpCsFixer\Fixer\Operator\TernaryOperatorSpacesFixer::class); - $services->set(\PhpCsFixer\Fixer\ClassNotation\VisibilityRequiredFixer::class); - $services->set(\PhpCsFixer\Fixer\Casing\ConstantCaseFixer::class); - $services->set(\PhpCsFixer\Fixer\Casing\LowercaseKeywordsFixer::class); - $services->set(\PhpCsFixer\Fixer\ControlStructure\NoBreakCommentFixer::class); - $services->set(\PhpCsFixer\Fixer\PhpTag\NoClosingTagFixer::class); - $services->set(\PhpCsFixer\Fixer\Operator\NoSpaceAroundDoubleColonFixer::class); - $services->set(\PhpCsFixer\Fixer\Whitespace\NoTrailingWhitespaceFixer::class); - $services->set(\PhpCsFixer\Fixer\Comment\NoTrailingWhitespaceInCommentFixer::class); - $services->set(\PhpCsFixer\Fixer\ControlStructure\SwitchCaseSemicolonToColonFixer::class); - $services->set(\PhpCsFixer\Fixer\ControlStructure\SwitchCaseSpaceFixer::class); - $services->set(\PhpCsFixer\Fixer\Casing\ClassReferenceNameCasingFixer::class); - $services->set(\PhpCsFixer\Fixer\NamespaceNotation\CleanNamespaceFixer::class); - $services->set(\PhpCsFixer\Fixer\Operator\ConcatSpaceFixer::class); - $services->set(\PhpCsFixer\Fixer\PhpTag\EchoTagSyntaxFixer::class); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\FunctionTypehintSpaceFixer::class); - $services->set(\PhpCsFixer\Fixer\ControlStructure\IncludeFixer::class); - $services->set(\PhpCsFixer\Fixer\Operator\IncrementStyleFixer::class); - $services->set(\PhpCsFixer\Fixer\Casing\IntegerLiteralCaseFixer::class); - $services->set(\PhpCsFixer\Fixer\PhpTag\LinebreakAfterOpeningTagFixer::class); - $services->set(\PhpCsFixer\Fixer\Casing\MagicConstantCasingFixer::class); - $services->set(\PhpCsFixer\Fixer\Casing\MagicMethodCasingFixer::class); - $services->set(\PhpCsFixer\Fixer\Casing\NativeFunctionCasingFixer::class); - $services->set(\PhpCsFixer\Fixer\Casing\NativeFunctionTypeDeclarationCasingFixer::class); - $services->set(\PhpCsFixer\Fixer\Alias\NoAliasLanguageConstructCallFixer::class); - $services->set(\PhpCsFixer\Fixer\StringNotation\NoBinaryStringFixer::class); - $services->set(\PhpCsFixer\Fixer\NamespaceNotation\NoLeadingNamespaceWhitespaceFixer::class); - $services->set(\PhpCsFixer\Fixer\Semicolon\NoSinglelineWhitespaceBeforeSemicolonsFixer::class); - $services->set(\PhpCsFixer\Fixer\Whitespace\NoSpacesAroundOffsetFixer::class); - $services->set(\PhpCsFixer\Fixer\ControlStructure\NoTrailingCommaInListCallFixer::class); - $services->set(\PhpCsFixer\Fixer\ArrayNotation\NoTrailingCommaInSinglelineArrayFixer::class); - $services->set(\PhpCsFixer\Fixer\CastNotation\NoUnsetCastFixer::class); - $services->set(\PhpCsFixer\Fixer\ArrayNotation\NoWhitespaceBeforeCommaInArrayFixer::class); - $services->set(\PhpCsFixer\Fixer\ArrayNotation\NormalizeIndexBraceFixer::class); - $services->set(\PhpCsFixer\Fixer\Operator\ObjectOperatorWithoutWhitespaceFixer::class); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitMethodCasingFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocInlineTagNormalizerFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocSummaryFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocTagTypeFixer::class) - ->call('configure', [ - [ - 'tags' => [ - 'inheritDoc' => 'inline', - ], - ], - ]); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocTypesOrderFixer::class) - ->call('configure', [ - [ - 'null_adjustment' => 'always_last', - 'sort_algorithm' => 'none', - ], - ]); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocVarWithoutNameFixer::class); - $services->set(\PhpCsFixer\Fixer\StringNotation\SingleQuoteFixer::class); - $services->set(\PhpCsFixer\Fixer\Operator\StandardizeNotEqualsFixer::class); - $services->set(\PhpCsFixer\Fixer\ControlStructure\SwitchContinueToBreakFixer::class); - $services->set(\PhpCsFixer\Fixer\ControlStructure\TrailingCommaInMultilineFixer::class); - $services->set(\PhpCsFixer\Fixer\ArrayNotation\TrimArraySpacesFixer::class); - $services->set(\PhpCsFixer\Fixer\Whitespace\TypesSpacesFixer::class); - $services->set(\PhpCsFixer\Fixer\Operator\UnaryOperatorSpacesFixer::class); - $services->set(\PhpCsFixer\Fixer\ArrayNotation\WhitespaceAfterCommaInArrayFixer::class); - $services->set(\PhpCsFixer\Fixer\ControlStructure\YodaStyleFixer::class); - $services->set(\PhpCsFixer\Fixer\Semicolon\SpaceAfterSemicolonFixer::class) - ->call('configure', [ - [ - 'remove_in_empty_for_expressions' => true, - ], - ]); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocSeparationFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocTrimFixer::class); - $services->set(\PhpCsFixer\Fixer\CastNotation\NoShortBoolCastFixer::class); - $services->set(\PhpCsFixer\Fixer\PhpUnit\PhpUnitFqcnAnnotationFixer::class); - $services->set(\PhpCsFixer\Fixer\CastNotation\CastSpacesFixer::class); - $services->set(\PhpCsFixer\Fixer\Alias\NoMixedEchoPrintFixer::class); - $services->set(\PhpCsFixer\Fixer\Import\NoUnusedImportsFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocSingleLineVarSpacingFixer::class); - $services->set(\PhpCsFixer\Fixer\Import\SingleLineAfterImportsFixer::class); - $services->set(\PhpCsFixer\Fixer\FunctionNotation\ReturnTypeDeclarationFixer::class); - $services->set(\PhpCsFixer\Fixer\Whitespace\NoWhitespaceInBlankLineFixer::class); - $services->set(\PhpCsFixer\Fixer\Import\NoLeadingImportSlashFixer::class); - $services->set(\PhpCsFixer\Fixer\NamespaceNotation\BlankLineAfterNamespaceFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\NoBlankLinesAfterPhpdocFixer::class); - $services->set(\PhpCsFixer\Fixer\Whitespace\NoExtraBlankLinesFixer::class) - ->call('configure', [ - [ - 'tokens' => [ - 'case', - 'continue', - 'curly_brace_block', - 'default', - 'extra', - 'parenthesis_brace_block', - 'square_brace_block', - 'switch', - 'throw', - 'use', - ], - ], - ]); - $services->set(\PhpCsFixer\Fixer\NamespaceNotation\SingleBlankLineBeforeNamespaceFixer::class); - $services->set(\PhpCsFixer\Fixer\Whitespace\BlankLineBeforeStatementFixer::class) - ->call('configure', [ - [ - 'statements' => ['return'], - ], - ]); - $services->set(\PhpCsFixer\Fixer\Import\OrderedImportsFixer::class); - $services->set(\PhpCsFixer\Fixer\Comment\SingleLineCommentStyleFixer::class) - ->call('configure', [ - [ - 'comment_types' => ['hash'], - ], - ]); - $services->set(\PhpCsFixer\Fixer\Operator\BinaryOperatorSpacesFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocTrimConsecutiveBlankLineSeparationFixer::class); - $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocAlignFixer::class); - $services->set(\PhpCsFixer\Fixer\Whitespace\SingleBlankLineAtEofFixer::class); +return static function (ECSConfig $containerConfigurator): void { + $containerConfigurator->rule(\PhpCsFixer\Fixer\Basic\EncodingFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\PhpTag\FullOpeningTagFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ClassNotation\ProtectedToPrivateFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\ClassNotation\OrderedClassElementsFixer::class, [ + 'order' => ['use_trait'], + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ClassNotation\SingleClassElementPerStatementFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\ClassNotation\ClassAttributesSeparationFixer::class, [ + 'elements' => [ + 'method' => 'one', + ], + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Whitespace\IndentationTypeFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ControlStructure\NoAlternativeSyntaxFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ControlStructure\ElseifFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Whitespace\LineEndingFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Semicolon\NoEmptyStatementFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\ControlStructure\NoUnneededCurlyBracesFixer::class, [ + 'namespaces' => true, + ]); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\ControlStructure\EmptyLoopBodyFixer::class, [ + 'style' => 'braces', + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Operator\NewWithBracesFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\ClassNotation\ClassDefinitionFixer::class, [ + 'single_line' => true, + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ClassNotation\SingleTraitInsertPerStatementFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\FunctionNotation\SingleLineThrowFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\LanguageConstruct\SingleSpaceAfterConstructFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\Basic\BracesFixer::class, [ + 'allow_single_line_anonymous_class_with_empty_body' => true, + 'allow_single_line_closure' => true, + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\FunctionNotation\FunctionDeclarationFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ArrayNotation\NoMultilineWhitespaceAroundDoubleArrowFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\FunctionNotation\MethodArgumentSpaceFixer::class, [ + 'on_multiline' => 'ignore', + ]); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\ControlStructure\NoUnneededControlParenthesesFixer::class, [ + 'statements' => [ + 'break', + 'clone', + 'continue', + 'echo_print', + 'return', + 'switch_case', + 'yield', + 'yield_from', + ], + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocToCommentFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocIndentFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocAnnotationWithoutDotFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocTypesFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocScalarFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\Phpdoc\GeneralPhpdocTagRenameFixer::class, [ + 'replacements' => [ + 'inheritDocs' => 'inheritDoc', + ], + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocNoAliasTagFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocNoAccessFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocNoPackageFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocReturnSelfReferenceFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Import\FullyQualifiedStrictTypesFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\Phpdoc\NoSuperfluousPhpdocTagsFixer::class, [ + 'allow_mixed' => true, + 'allow_unused_params' => true, + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocNoUselessInheritdocFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\FunctionNotation\LambdaNotUsedImportFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\NoEmptyPhpdocFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\FunctionNotation\NoTrailingCommaInSinglelineFunctionCallFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\FunctionNotation\NoSpacesAfterFunctionNameFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Whitespace\NoSpacesInsideParenthesisFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Alias\BacktickToShellExecFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Comment\NoEmptyCommentFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Semicolon\SemicolonAfterInstructionFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\PhpTag\BlankLineAfterOpeningTagFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Import\SingleImportPerStatementFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ControlStructure\EmptyLoopConditionFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Import\NoUnneededImportAliasFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Comment\SingleLineCommentSpacingFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Operator\StandardizeIncrementFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Whitespace\CompactNullableTypehintFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\LanguageConstruct\DeclareEqualNormalizeFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\CastNotation\LowercaseCastFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Casing\LowercaseStaticReferenceFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ClassNotation\NoBlankLinesAfterClassOpeningFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\CastNotation\ShortScalarCastFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Operator\TernaryOperatorSpacesFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ClassNotation\VisibilityRequiredFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Casing\ConstantCaseFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Casing\LowercaseKeywordsFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ControlStructure\NoBreakCommentFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\PhpTag\NoClosingTagFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Operator\NoSpaceAroundDoubleColonFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Whitespace\NoTrailingWhitespaceFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Comment\NoTrailingWhitespaceInCommentFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ControlStructure\SwitchCaseSemicolonToColonFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ControlStructure\SwitchCaseSpaceFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Casing\ClassReferenceNameCasingFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\NamespaceNotation\CleanNamespaceFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Operator\ConcatSpaceFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\PhpTag\EchoTagSyntaxFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\FunctionNotation\FunctionTypehintSpaceFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ControlStructure\IncludeFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Operator\IncrementStyleFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Casing\IntegerLiteralCaseFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\PhpTag\LinebreakAfterOpeningTagFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Casing\MagicConstantCasingFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Casing\MagicMethodCasingFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Casing\NativeFunctionCasingFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Casing\NativeFunctionTypeDeclarationCasingFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Alias\NoAliasLanguageConstructCallFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\StringNotation\NoBinaryStringFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\NamespaceNotation\NoLeadingNamespaceWhitespaceFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Semicolon\NoSinglelineWhitespaceBeforeSemicolonsFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Whitespace\NoSpacesAroundOffsetFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ControlStructure\NoTrailingCommaInListCallFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ArrayNotation\NoTrailingCommaInSinglelineArrayFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\CastNotation\NoUnsetCastFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ArrayNotation\NoWhitespaceBeforeCommaInArrayFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ArrayNotation\NormalizeIndexBraceFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Operator\ObjectOperatorWithoutWhitespaceFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\PhpUnit\PhpUnitMethodCasingFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocInlineTagNormalizerFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocSummaryFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\Phpdoc\PhpdocTagTypeFixer::class, [ + 'tags' => [ + 'inheritDoc' => 'inline', + ], + ]); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\Phpdoc\PhpdocTypesOrderFixer::class, [ + 'null_adjustment' => 'always_last', + 'sort_algorithm' => 'none', + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocVarWithoutNameFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\StringNotation\SingleQuoteFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Operator\StandardizeNotEqualsFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ControlStructure\SwitchContinueToBreakFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ControlStructure\TrailingCommaInMultilineFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ArrayNotation\TrimArraySpacesFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Whitespace\TypesSpacesFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Operator\UnaryOperatorSpacesFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ArrayNotation\WhitespaceAfterCommaInArrayFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\ControlStructure\YodaStyleFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\Semicolon\SpaceAfterSemicolonFixer::class, [ + 'remove_in_empty_for_expressions' => true, + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocSeparationFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocTrimFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\CastNotation\NoShortBoolCastFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\PhpUnit\PhpUnitFqcnAnnotationFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\CastNotation\CastSpacesFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Alias\NoMixedEchoPrintFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Import\NoUnusedImportsFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocSingleLineVarSpacingFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Import\SingleLineAfterImportsFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\FunctionNotation\ReturnTypeDeclarationFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Whitespace\NoWhitespaceInBlankLineFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Import\NoLeadingImportSlashFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\NamespaceNotation\BlankLineAfterNamespaceFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\NoBlankLinesAfterPhpdocFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\Whitespace\NoExtraBlankLinesFixer::class, [ + 'tokens' => [ + 'case', + 'continue', + 'curly_brace_block', + 'default', + 'extra', + 'parenthesis_brace_block', + 'square_brace_block', + 'switch', + 'throw', + 'use', + ], + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\NamespaceNotation\SingleBlankLineBeforeNamespaceFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\Whitespace\BlankLineBeforeStatementFixer::class, [ + 'statements' => ['return'], + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Import\OrderedImportsFixer::class); + $containerConfigurator->ruleWithConfiguration(\PhpCsFixer\Fixer\Comment\SingleLineCommentStyleFixer::class, [ + 'comment_types' => ['hash'], + ]); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Operator\BinaryOperatorSpacesFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocTrimConsecutiveBlankLineSeparationFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocAlignFixer::class); + $containerConfigurator->rule(\PhpCsFixer\Fixer\Whitespace\SingleBlankLineAtEofFixer::class); }; diff --git a/config/set/php54.php b/config/set/php54.php index 35aa423..c3ffc1a 100644 --- a/config/set/php54.php +++ b/config/set/php54.php @@ -4,9 +4,12 @@ use PHP_CodeSniffer\Config; use Rector\Core\ValueObject\PhpVersion; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Symplify\EasyCodingStandard\Config\ECSConfig; +use Zing\CodingStandard\Set\PhpCsFixerSetList; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (ECSConfig $ecsConfig): void { Config::setConfigData('php_version', PhpVersion::PHP_54); - $containerConfigurator->import(\Zing\CodingStandard\Set\PhpCsFixerSetList::PHP54_MIGRATION); + $ecsConfig->sets([ + PhpCsFixerSetList::PHP54_MIGRATION, + ]); }; diff --git a/config/set/php56.php b/config/set/php56.php index f875454..2affa4a 100644 --- a/config/set/php56.php +++ b/config/set/php56.php @@ -4,10 +4,13 @@ use PHP_CodeSniffer\Config; use Rector\Core\ValueObject\PhpVersion; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Symplify\EasyCodingStandard\Config\ECSConfig; +use Zing\CodingStandard\Set\PhpCsFixerSetList; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (ECSConfig $ecsConfig): void { Config::setConfigData('php_version', PhpVersion::PHP_56); - $containerConfigurator->import(\Zing\CodingStandard\Set\PhpCsFixerSetList::PHP54_MIGRATION); - $containerConfigurator->import(\Zing\CodingStandard\Set\PhpCsFixerSetList::PHP56_MIGRATION_RISKY); + $ecsConfig->sets([ + PhpCsFixerSetList::PHP54_MIGRATION, + PhpCsFixerSetList::PHP56_MIGRATION_RISKY, + ]); }; diff --git a/config/set/php70.php b/config/set/php70.php index ef36398..7591d6a 100644 --- a/config/set/php70.php +++ b/config/set/php70.php @@ -4,10 +4,13 @@ use PHP_CodeSniffer\Config; use Rector\Core\ValueObject\PhpVersion; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Symplify\EasyCodingStandard\Config\ECSConfig; +use Zing\CodingStandard\Set\PhpCsFixerSetList; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (ECSConfig $ecsConfig): void { Config::setConfigData('php_version', PhpVersion::PHP_70); - $containerConfigurator->import(\Zing\CodingStandard\Set\PhpCsFixerSetList::PHP70_MIGRATION); - $containerConfigurator->import(\Zing\CodingStandard\Set\PhpCsFixerSetList::PHP70_MIGRATION_RISKY); + $ecsConfig->sets([ + PhpCsFixerSetList::PHP70_MIGRATION, + PhpCsFixerSetList::PHP70_MIGRATION_RISKY, + ]); }; diff --git a/config/set/php71.php b/config/set/php71.php index 58a1809..9266991 100644 --- a/config/set/php71.php +++ b/config/set/php71.php @@ -4,10 +4,13 @@ use PHP_CodeSniffer\Config; use Rector\Core\ValueObject\PhpVersion; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Symplify\EasyCodingStandard\Config\ECSConfig; +use Zing\CodingStandard\Set\PhpCsFixerSetList; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (ECSConfig $ecsConfig): void { Config::setConfigData('php_version', PhpVersion::PHP_71); - $containerConfigurator->import(\Zing\CodingStandard\Set\PhpCsFixerSetList::PHP71_MIGRATION); - $containerConfigurator->import(\Zing\CodingStandard\Set\PhpCsFixerSetList::PHP71_MIGRATION_RISKY); + $ecsConfig->sets([ + PhpCsFixerSetList::PHP71_MIGRATION, + PhpCsFixerSetList::PHP71_MIGRATION_RISKY, + ]); }; diff --git a/config/set/php72.php b/config/set/php72.php index fe55220..2cb4dcc 100644 --- a/config/set/php72.php +++ b/config/set/php72.php @@ -4,10 +4,13 @@ use PHP_CodeSniffer\Config; use Rector\Core\ValueObject\PhpVersion; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Symplify\EasyCodingStandard\Config\ECSConfig; +use Zing\CodingStandard\Set\PhpCsFixerSetList; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (ECSConfig $ecsConfig): void { Config::setConfigData('php_version', PhpVersion::PHP_72); - $containerConfigurator->import(\Zing\CodingStandard\Set\PhpCsFixerSetList::PHP71_MIGRATION); - $containerConfigurator->import(\Zing\CodingStandard\Set\PhpCsFixerSetList::PHP71_MIGRATION_RISKY); + $ecsConfig->sets([ + PhpCsFixerSetList::PHP71_MIGRATION, + PhpCsFixerSetList::PHP71_MIGRATION_RISKY, + ]); }; diff --git a/config/set/php73.php b/config/set/php73.php index f3332bd..5a3e13e 100644 --- a/config/set/php73.php +++ b/config/set/php73.php @@ -4,10 +4,13 @@ use PHP_CodeSniffer\Config; use Rector\Core\ValueObject\PhpVersion; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Symplify\EasyCodingStandard\Config\ECSConfig; +use Zing\CodingStandard\Set\PhpCsFixerSetList; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (ECSConfig $ecsConfig): void { Config::setConfigData('php_version', PhpVersion::PHP_73); - $containerConfigurator->import(\Zing\CodingStandard\Set\PhpCsFixerSetList::PHP73_MIGRATION); - $containerConfigurator->import(\Zing\CodingStandard\Set\PhpCsFixerSetList::PHP71_MIGRATION_RISKY); + $ecsConfig->sets([ + PhpCsFixerSetList::PHP73_MIGRATION, + PhpCsFixerSetList::PHP71_MIGRATION_RISKY, + ]); }; diff --git a/config/set/php74.php b/config/set/php74.php index 96752b0..ec6b5aa 100644 --- a/config/set/php74.php +++ b/config/set/php74.php @@ -4,10 +4,13 @@ use PHP_CodeSniffer\Config; use Rector\Core\ValueObject\PhpVersion; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Symplify\EasyCodingStandard\Config\ECSConfig; +use Zing\CodingStandard\Set\PhpCsFixerSetList; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (ECSConfig $ecsConfig): void { Config::setConfigData('php_version', PhpVersion::PHP_74); - $containerConfigurator->import(\Zing\CodingStandard\Set\PhpCsFixerSetList::PHP74_MIGRATION); - $containerConfigurator->import(\Zing\CodingStandard\Set\PhpCsFixerSetList::PHP74_MIGRATION_RISKY); + $ecsConfig->sets([ + PhpCsFixerSetList::PHP74_MIGRATION, + PhpCsFixerSetList::PHP74_MIGRATION_RISKY, + ]); }; diff --git a/config/set/php80.php b/config/set/php80.php index 2c6c861..ae48e68 100644 --- a/config/set/php80.php +++ b/config/set/php80.php @@ -4,10 +4,13 @@ use PHP_CodeSniffer\Config; use Rector\Core\ValueObject\PhpVersion; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Symplify\EasyCodingStandard\Config\ECSConfig; +use Zing\CodingStandard\Set\PhpCsFixerSetList; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (ECSConfig $ecsConfig): void { Config::setConfigData('php_version', PhpVersion::PHP_80); - $containerConfigurator->import(\Zing\CodingStandard\Set\PhpCsFixerSetList::PHP80_MIGRATION); - $containerConfigurator->import(\Zing\CodingStandard\Set\PhpCsFixerSetList::PHP80_MIGRATION_RISKY); + $ecsConfig->sets([ + PhpCsFixerSetList::PHP80_MIGRATION, + PhpCsFixerSetList::PHP80_MIGRATION_RISKY, + ]); }; diff --git a/config/set/php81.php b/config/set/php81.php index 9e49f74..fc1331f 100644 --- a/config/set/php81.php +++ b/config/set/php81.php @@ -4,10 +4,13 @@ use PHP_CodeSniffer\Config; use Rector\Core\ValueObject\PhpVersion; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Symplify\EasyCodingStandard\Config\ECSConfig; +use Zing\CodingStandard\Set\PhpCsFixerSetList; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (ECSConfig $ecsConfig): void { Config::setConfigData('php_version', PhpVersion::PHP_81); - $containerConfigurator->import(\Zing\CodingStandard\Set\PhpCsFixerSetList::PHP81_MIGRATION); - $containerConfigurator->import(\Zing\CodingStandard\Set\PhpCsFixerSetList::PHP80_MIGRATION_RISKY); + $ecsConfig->sets([ + PhpCsFixerSetList::PHP81_MIGRATION, + PhpCsFixerSetList::PHP80_MIGRATION_RISKY, + ]); }; diff --git a/config/set/php_codesniffer.php b/config/set/php_codesniffer.php index 487cdb4..a712ece 100644 --- a/config/set/php_codesniffer.php +++ b/config/set/php_codesniffer.php @@ -2,157 +2,164 @@ declare(strict_types=1); -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Symplify\EasyCodingStandard\Config\ECSConfig; -return static function (ContainerConfigurator $containerConfigurator): void { - $services = $containerConfigurator->services(); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Metrics\NestingLevelSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Metrics\CyclomaticComplexitySniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Strings\UnnecessaryStringConcatSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Classes\DuplicateClassNameSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis\UnusedFunctionParameterSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis\UselessOverridingMethodSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis\UnnecessaryFinalModifierSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis\ForLoopShouldBeWhileLoopSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis\JumbledIncrementerSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis\AssignmentInConditionSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis\EmptyPHPStatementSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis\UnconditionalIfStatementSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis\ForLoopWithTestFunctionCallSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis\EmptyStatementSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\ForbiddenFunctionsSniff::class) - ->property('forbiddenFunctions', [ +return static function (ECSConfig $containerConfigurator): void { + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Metrics\NestingLevelSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Metrics\CyclomaticComplexitySniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Strings\UnnecessaryStringConcatSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Classes\DuplicateClassNameSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis\UnusedFunctionParameterSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis\UselessOverridingMethodSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis\UnnecessaryFinalModifierSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis\ForLoopShouldBeWhileLoopSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis\JumbledIncrementerSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis\AssignmentInConditionSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis\EmptyPHPStatementSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis\UnconditionalIfStatementSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis\ForLoopWithTestFunctionCallSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis\EmptyStatementSniff::class); + $containerConfigurator->ruleWithConfiguration(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\ForbiddenFunctionsSniff::class, [ + 'forbiddenFunctions' => [ 'sizeof' => 'count', 'delete' => 'unset', 'print' => 'echo', 'is_null' => 'null', 'create_function' => 'null', - ]); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\CharacterBeforePHPOpeningTagSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\SyntaxSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\LowerCaseTypeSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DisallowShortOpenTagSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DisallowRequestSuperglobalSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\LowerCaseConstantSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DiscourageGotoSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DisallowAlternativePHPTagsSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\SAPIUsageSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\BacktickOperatorSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\LowerCaseKeywordSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\NoSilencedErrorsSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DeprecatedFunctionsSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\VersionControl\SubversionPropertiesSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\VersionControl\GitMergeConflictSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\ScopeIndentSniff::class) - ->property('ignoreIndentationTokens', ['T_COMMENT', 'T_DOC_COMMENT_OPEN_TAG']); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\ArbitraryParenthesesSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\DisallowTabIndentSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\IncrementDecrementSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\SpreadOperatorSpacingAfterSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting\DisallowMultipleStatementsSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting\SpaceAfterNotSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting\SpaceAfterCastSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Arrays\ArrayIndentSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Arrays\DisallowLongArraySyntaxSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\LineLengthSniff::class) - ->property('lineLimit', '120') - ->property('absoluteLineLimit', '0') - ->property('ignoreComments', 'true'); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\ByteOrderMarkSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\OneObjectStructurePerFileSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\LineEndingsSniff::class) - ->property('eolChar', '\\n'); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\OneTraitPerFileSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\OneInterfacePerFileSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\OneClassPerFileSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\ExecutableFileSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\EndFileNewlineSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Functions\FunctionCallArgumentSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Functions\CallTimePassByReferenceSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\ControlStructures\InlineControlStructureSniff::class) - ->property('error', 'true'); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\ControlStructures\DisallowYodaConditionsSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions\UpperCaseConstantNameSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Commenting\TodoSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Commenting\FixmeSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PEAR\Sniffs\Classes\ClassDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PEAR\Sniffs\WhiteSpace\ObjectOperatorIndentSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PEAR\Sniffs\WhiteSpace\ScopeClosingBraceSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PEAR\Sniffs\Functions\FunctionDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PEAR\Sniffs\Functions\ValidDefaultValueSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PEAR\Sniffs\NamingConventions\ValidClassNameSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PEAR\Sniffs\Commenting\InlineCommentSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\DocCommentAlignmentSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR1\Sniffs\Methods\CamelCapsMethodNameSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR1\Sniffs\Classes\ClassDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR1\Sniffs\Files\SideEffectsSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes\ValidClassNameSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR2\Sniffs\Methods\FunctionCallSignatureSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR2\Sniffs\Methods\MethodDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR2\Sniffs\Methods\FunctionClosingBraceSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR2\Sniffs\Classes\PropertyDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR2\Sniffs\Classes\ClassDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR2\Sniffs\Namespaces\UseDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR2\Sniffs\Namespaces\NamespaceDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR2\Sniffs\Files\ClosingTagSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR2\Sniffs\Files\EndFileNewlineSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR2\Sniffs\ControlStructures\SwitchDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR2\Sniffs\ControlStructures\ElseIfDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\SuperfluousWhitespaceSniff::class) - ->property('ignoreBlankLines', 'true'); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Scope\MethodScopeSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\ScopeKeywordSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\FunctionDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\LowercaseFunctionKeywordsSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\FunctionDeclarationArgumentSpacingSniff::class) - ->property('equalsSpacing', '1'); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\MultiLineFunctionDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\ControlSignatureSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\ScopeClosingBraceSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\ForEachLoopDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\ForLoopDeclarationSniff::class) - ->property('ignoreNewlines', 'true'); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\LowercaseDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR12\Sniffs\Classes\OpeningBraceSpaceSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR12\Sniffs\Classes\ClosingBraceSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR12\Sniffs\Classes\ClassInstantiationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR12\Sniffs\Namespaces\CompoundNamespaceDepthSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR12\Sniffs\Properties\ConstantVisibilitySniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR12\Sniffs\Files\ImportStatementSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR12\Sniffs\Files\OpenTagSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR12\Sniffs\Files\DeclareStatementSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR12\Sniffs\Functions\NullableTypeDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR12\Sniffs\Functions\ReturnTypeDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR12\Sniffs\ControlStructures\ControlStructureSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR12\Sniffs\ControlStructures\BooleanOperatorPlacementSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR12\Sniffs\Keywords\ShortFormTypeKeywordsSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\CastSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Strings\EchoedStringsSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Operators\IncrementDecrementUsageSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Operators\ValidLogicalOperatorsSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes\LowercaseClassKeywordsSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes\SelfMemberReferenceSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes\ClassDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Scope\MemberVarScopeSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Scope\StaticThisUsageSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\InnerFunctionsSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\EvalSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\GlobalKeywordSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\DiscouragedFunctionsSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\CommentedOutCodeSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\LowercasePHPFunctionsSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\DisallowSizeFunctionsInLoopsSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\EmbeddedPhpSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\NonExecutableCodeSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\LogicalOperatorSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\LanguageConstructSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\FunctionOpeningBraceSpaceSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\SemicolonSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Arrays\ArrayBracketSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\GlobalFunctionSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\FunctionDuplicateArgumentSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\LongConditionClosingCommentSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\EmptyCatchCommentSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Zend\Sniffs\Files\ClosingTagSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Zend\Sniffs\Debug\CodeAnalyzerSniff::class); + ], + ]); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\CharacterBeforePHPOpeningTagSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\SyntaxSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\LowerCaseTypeSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DisallowShortOpenTagSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DisallowRequestSuperglobalSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\LowerCaseConstantSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DiscourageGotoSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DisallowAlternativePHPTagsSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\SAPIUsageSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\BacktickOperatorSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\LowerCaseKeywordSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\NoSilencedErrorsSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DeprecatedFunctionsSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\VersionControl\SubversionPropertiesSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\VersionControl\GitMergeConflictSniff::class); + $containerConfigurator->ruleWithConfiguration(\PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\ScopeIndentSniff::class, [ + 'ignoreIndentationTokens' => ['T_COMMENT', 'T_DOC_COMMENT_OPEN_TAG'], + ]); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\ArbitraryParenthesesSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\DisallowTabIndentSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\IncrementDecrementSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\SpreadOperatorSpacingAfterSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting\DisallowMultipleStatementsSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting\SpaceAfterNotSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting\SpaceAfterCastSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Arrays\ArrayIndentSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Arrays\DisallowLongArraySyntaxSniff::class); + $containerConfigurator->ruleWithConfiguration(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\LineLengthSniff::class, [ + 'lineLimit' => '120', + 'absoluteLineLimit' => '0', + 'ignoreComments' => 'true', + ]); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\ByteOrderMarkSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\OneObjectStructurePerFileSniff::class); + $containerConfigurator->ruleWithConfiguration(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\LineEndingsSniff::class, [ + 'eolChar' => '\\n', + ]); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\OneTraitPerFileSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\OneInterfacePerFileSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\OneClassPerFileSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\ExecutableFileSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\EndFileNewlineSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Functions\FunctionCallArgumentSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Functions\CallTimePassByReferenceSniff::class); + $containerConfigurator->ruleWithConfiguration(\PHP_CodeSniffer\Standards\Generic\Sniffs\ControlStructures\InlineControlStructureSniff::class, [ + 'error' => 'true', + ]); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\ControlStructures\DisallowYodaConditionsSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions\UpperCaseConstantNameSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Commenting\TodoSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Commenting\FixmeSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PEAR\Sniffs\Classes\ClassDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PEAR\Sniffs\WhiteSpace\ObjectOperatorIndentSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PEAR\Sniffs\WhiteSpace\ScopeClosingBraceSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PEAR\Sniffs\Functions\FunctionDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PEAR\Sniffs\Functions\ValidDefaultValueSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PEAR\Sniffs\NamingConventions\ValidClassNameSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PEAR\Sniffs\Commenting\InlineCommentSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\DocCommentAlignmentSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR1\Sniffs\Methods\CamelCapsMethodNameSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR1\Sniffs\Classes\ClassDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR1\Sniffs\Files\SideEffectsSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes\ValidClassNameSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR2\Sniffs\Methods\FunctionCallSignatureSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR2\Sniffs\Methods\MethodDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR2\Sniffs\Methods\FunctionClosingBraceSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR2\Sniffs\Classes\PropertyDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR2\Sniffs\Classes\ClassDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR2\Sniffs\Namespaces\UseDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR2\Sniffs\Namespaces\NamespaceDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR2\Sniffs\Files\ClosingTagSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR2\Sniffs\Files\EndFileNewlineSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR2\Sniffs\ControlStructures\SwitchDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR2\Sniffs\ControlStructures\ElseIfDeclarationSniff::class); + $containerConfigurator->ruleWithConfiguration(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\SuperfluousWhitespaceSniff::class, [ + 'ignoreBlankLines' => 'true', + ]); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Scope\MethodScopeSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\ScopeKeywordSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\FunctionDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\LowercaseFunctionKeywordsSniff::class); + $containerConfigurator->ruleWithConfiguration(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\FunctionDeclarationArgumentSpacingSniff::class, [ + 'equalsSpacing' => '1', + ]); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\MultiLineFunctionDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\ControlSignatureSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\ScopeClosingBraceSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\ForEachLoopDeclarationSniff::class); + $containerConfigurator->ruleWithConfiguration(\PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\ForLoopDeclarationSniff::class, [ + 'ignoreNewlines' => 'true', + ]); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\LowercaseDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR12\Sniffs\Classes\OpeningBraceSpaceSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR12\Sniffs\Classes\ClosingBraceSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR12\Sniffs\Classes\ClassInstantiationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR12\Sniffs\Namespaces\CompoundNamespaceDepthSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR12\Sniffs\Properties\ConstantVisibilitySniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR12\Sniffs\Files\ImportStatementSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR12\Sniffs\Files\OpenTagSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR12\Sniffs\Files\DeclareStatementSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR12\Sniffs\Functions\NullableTypeDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR12\Sniffs\Functions\ReturnTypeDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR12\Sniffs\ControlStructures\ControlStructureSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR12\Sniffs\ControlStructures\BooleanOperatorPlacementSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR12\Sniffs\Keywords\ShortFormTypeKeywordsSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\CastSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Strings\EchoedStringsSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Operators\IncrementDecrementUsageSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Operators\ValidLogicalOperatorsSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes\LowercaseClassKeywordsSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes\SelfMemberReferenceSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes\ClassDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Scope\MemberVarScopeSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Scope\StaticThisUsageSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\InnerFunctionsSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\EvalSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\GlobalKeywordSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\DiscouragedFunctionsSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\CommentedOutCodeSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\LowercasePHPFunctionsSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\DisallowSizeFunctionsInLoopsSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\EmbeddedPhpSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\NonExecutableCodeSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\LogicalOperatorSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\LanguageConstructSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\FunctionOpeningBraceSpaceSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\SemicolonSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Arrays\ArrayBracketSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\GlobalFunctionSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\FunctionDuplicateArgumentSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\LongConditionClosingCommentSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\EmptyCatchCommentSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Zend\Sniffs\Files\ClosingTagSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Zend\Sniffs\Debug\CodeAnalyzerSniff::class); }; diff --git a/config/set/php_codesniffer/generic.php b/config/set/php_codesniffer/generic.php index 69c3d42..fe57193 100644 --- a/config/set/php_codesniffer/generic.php +++ b/config/set/php_codesniffer/generic.php @@ -2,89 +2,88 @@ declare(strict_types=1); -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Symplify\EasyCodingStandard\Config\ECSConfig; -return static function (ContainerConfigurator $containerConfigurator): void { - $services = $containerConfigurator->services(); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Metrics\NestingLevelSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Metrics\CyclomaticComplexitySniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Strings\UnnecessaryStringConcatSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Classes\DuplicateClassNameSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Classes\OpeningBraceSameLineSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis\UnusedFunctionParameterSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis\UselessOverridingMethodSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis\UnnecessaryFinalModifierSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis\ForLoopShouldBeWhileLoopSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis\JumbledIncrementerSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis\AssignmentInConditionSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis\EmptyPHPStatementSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis\UnconditionalIfStatementSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis\ForLoopWithTestFunctionCallSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis\EmptyStatementSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\ForbiddenFunctionsSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\CharacterBeforePHPOpeningTagSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\SyntaxSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\LowerCaseTypeSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\ClosingPHPTagSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\RequireStrictTypesSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DisallowShortOpenTagSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DisallowRequestSuperglobalSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\LowerCaseConstantSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\UpperCaseConstantSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DiscourageGotoSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DisallowAlternativePHPTagsSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\SAPIUsageSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\BacktickOperatorSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\LowerCaseKeywordSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\NoSilencedErrorsSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DeprecatedFunctionsSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\VersionControl\SubversionPropertiesSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\VersionControl\GitMergeConflictSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\ScopeIndentSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\ArbitraryParenthesesSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\DisallowTabIndentSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\IncrementDecrementSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\LanguageConstructSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\DisallowSpaceIndentSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\SpreadOperatorSpacingAfterSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting\DisallowMultipleStatementsSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting\NoSpaceAfterCastSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting\SpaceAfterNotSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting\SpaceAfterCastSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting\SpaceBeforeCastSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting\MultipleStatementAlignmentSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Arrays\ArrayIndentSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Arrays\DisallowLongArraySyntaxSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Arrays\DisallowShortArraySyntaxSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\LineLengthSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\ByteOrderMarkSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\OneObjectStructurePerFileSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\LineEndingsSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\OneTraitPerFileSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\InlineHTMLSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\EndFileNoNewlineSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\OneInterfacePerFileSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\LowercasedFilenameSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\OneClassPerFileSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\ExecutableFileSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\EndFileNewlineSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Functions\OpeningFunctionBraceKernighanRitchieSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Functions\FunctionCallArgumentSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Functions\CallTimePassByReferenceSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Functions\OpeningFunctionBraceBsdAllmanSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\ControlStructures\InlineControlStructureSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\ControlStructures\DisallowYodaConditionsSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions\TraitNameSuffixSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions\UpperCaseConstantNameSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions\InterfaceNameSuffixSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions\AbstractClassNamePrefixSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions\ConstructorNameSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions\CamelCapsFunctionNameSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Commenting\DocCommentSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Commenting\TodoSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Commenting\FixmeSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Debug\CSSLintSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Debug\ESLintSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Debug\JSHintSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Debug\ClosureLinterSniff::class); +return static function (ECSConfig $containerConfigurator): void { + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Metrics\NestingLevelSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Metrics\CyclomaticComplexitySniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Strings\UnnecessaryStringConcatSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Classes\DuplicateClassNameSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Classes\OpeningBraceSameLineSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis\UnusedFunctionParameterSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis\UselessOverridingMethodSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis\UnnecessaryFinalModifierSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis\ForLoopShouldBeWhileLoopSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis\JumbledIncrementerSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis\AssignmentInConditionSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis\EmptyPHPStatementSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis\UnconditionalIfStatementSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis\ForLoopWithTestFunctionCallSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis\EmptyStatementSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\ForbiddenFunctionsSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\CharacterBeforePHPOpeningTagSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\SyntaxSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\LowerCaseTypeSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\ClosingPHPTagSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\RequireStrictTypesSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DisallowShortOpenTagSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DisallowRequestSuperglobalSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\LowerCaseConstantSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\UpperCaseConstantSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DiscourageGotoSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DisallowAlternativePHPTagsSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\SAPIUsageSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\BacktickOperatorSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\LowerCaseKeywordSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\NoSilencedErrorsSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DeprecatedFunctionsSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\VersionControl\SubversionPropertiesSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\VersionControl\GitMergeConflictSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\ScopeIndentSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\ArbitraryParenthesesSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\DisallowTabIndentSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\IncrementDecrementSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\LanguageConstructSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\DisallowSpaceIndentSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\SpreadOperatorSpacingAfterSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting\DisallowMultipleStatementsSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting\NoSpaceAfterCastSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting\SpaceAfterNotSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting\SpaceAfterCastSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting\SpaceBeforeCastSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting\MultipleStatementAlignmentSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Arrays\ArrayIndentSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Arrays\DisallowLongArraySyntaxSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Arrays\DisallowShortArraySyntaxSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\LineLengthSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\ByteOrderMarkSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\OneObjectStructurePerFileSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\LineEndingsSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\OneTraitPerFileSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\InlineHTMLSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\EndFileNoNewlineSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\OneInterfacePerFileSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\LowercasedFilenameSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\OneClassPerFileSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\ExecutableFileSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\EndFileNewlineSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Functions\OpeningFunctionBraceKernighanRitchieSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Functions\FunctionCallArgumentSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Functions\CallTimePassByReferenceSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Functions\OpeningFunctionBraceBsdAllmanSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\ControlStructures\InlineControlStructureSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\ControlStructures\DisallowYodaConditionsSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions\TraitNameSuffixSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions\UpperCaseConstantNameSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions\InterfaceNameSuffixSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions\AbstractClassNamePrefixSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions\ConstructorNameSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions\CamelCapsFunctionNameSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Commenting\DocCommentSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Commenting\TodoSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Commenting\FixmeSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Debug\CSSLintSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Debug\ESLintSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Debug\JSHintSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Debug\ClosureLinterSniff::class); }; diff --git a/config/set/php_codesniffer/my-source.php b/config/set/php_codesniffer/my-source.php index 3fe703e..30228e8 100644 --- a/config/set/php_codesniffer/my-source.php +++ b/config/set/php_codesniffer/my-source.php @@ -2,171 +2,176 @@ declare(strict_types=1); -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Symplify\EasyCodingStandard\Config\ECSConfig; -return static function (ContainerConfigurator $containerConfigurator): void { - $services = $containerConfigurator->services(); - $services->set(\PHP_CodeSniffer\Standards\MySource\Sniffs\Strings\JoinStringsSniff::class); - $services->set(\PHP_CodeSniffer\Standards\MySource\Sniffs\CSS\BrowserSpecificStylesSniff::class); - $services->set(\PHP_CodeSniffer\Standards\MySource\Sniffs\Objects\CreateWidgetTypeCallbackSniff::class); - $services->set(\PHP_CodeSniffer\Standards\MySource\Sniffs\Objects\AssignThisSniff::class); - $services->set(\PHP_CodeSniffer\Standards\MySource\Sniffs\Objects\DisallowNewWidgetSniff::class); - $services->set(\PHP_CodeSniffer\Standards\MySource\Sniffs\PHP\EvalObjectFactorySniff::class); - $services->set(\PHP_CodeSniffer\Standards\MySource\Sniffs\PHP\AjaxNullComparisonSniff::class); - $services->set(\PHP_CodeSniffer\Standards\MySource\Sniffs\PHP\GetRequestDataSniff::class); - $services->set(\PHP_CodeSniffer\Standards\MySource\Sniffs\PHP\ReturnFunctionValueSniff::class); - $services->set(\PHP_CodeSniffer\Standards\MySource\Sniffs\Commenting\FunctionCommentSniff::class); - $services->set(\PHP_CodeSniffer\Standards\MySource\Sniffs\Debug\FirebugConsoleSniff::class); - $services->set(\PHP_CodeSniffer\Standards\MySource\Sniffs\Debug\DebugCodeSniff::class); - $services->set(\PHP_CodeSniffer\Standards\MySource\Sniffs\Channels\DisallowSelfActionsSniff::class); - $services->set(\PHP_CodeSniffer\Standards\MySource\Sniffs\Channels\IncludeSystemSniff::class); - $services->set(\PHP_CodeSniffer\Standards\MySource\Sniffs\Channels\IncludeOwnSystemSniff::class); - $services->set(\PHP_CodeSniffer\Standards\MySource\Sniffs\Channels\UnusedSystemSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Strings\ConcatenationSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Strings\DoubleQuoteUsageSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Strings\EchoedStringsSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Operators\ComparisonOperatorUsageSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Operators\IncrementDecrementUsageSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Operators\ValidLogicalOperatorsSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\DisallowMultipleStyleDefinitionsSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\LowercaseStyleDefinitionSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\ClassDefinitionNameSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\OpacitySniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\ClassDefinitionOpeningBraceSpaceSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\ColonSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\ForbiddenStylesSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\NamedColoursSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\ClassDefinitionClosingBraceSpaceSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\ColourDefinitionSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\DuplicateClassDefinitionSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\EmptyStyleDefinitionSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\EmptyClassDefinitionSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\MissingColonSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\DuplicateStyleDefinitionSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\ShorthandSizeSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\SemicolonSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\IndentationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes\ValidClassNameSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes\DuplicatePropertySniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes\LowercaseClassKeywordsSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes\SelfMemberReferenceSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes\ClassFileNameSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes\ClassDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Objects\ObjectMemberCommaSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Objects\ObjectInstantiationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Objects\DisallowObjectStringIndexSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Scope\MemberVarScopeSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Scope\MethodScopeSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Scope\StaticThisUsageSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\HeredocSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\DisallowMultipleAssignmentsSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\InnerFunctionsSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\EvalSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\GlobalKeywordSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\DisallowBooleanStatementSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\DiscouragedFunctionsSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\CommentedOutCodeSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\LowercasePHPFunctionsSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\DisallowSizeFunctionsInLoopsSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\DisallowInlineIfSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\DisallowComparisonAssignmentSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\EmbeddedPhpSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\NonExecutableCodeSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\PropertyLabelSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\ControlStructureSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\FunctionSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\MemberVarSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\CastSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\FunctionClosingBraceSpaceSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\OperatorSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\ObjectOperatorSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\LogicalOperatorSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\ScopeClosingBraceSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\SuperfluousWhitespaceSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\LanguageConstructSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\FunctionOpeningBraceSpaceSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\ScopeKeywordSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\SemicolonSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Formatting\OperatorBracketSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Arrays\ArrayDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Arrays\ArrayBracketSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Files\FileExtensionSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\FunctionDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\GlobalFunctionSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\FunctionDeclarationArgumentSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\FunctionDuplicateArgumentSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\LowercaseFunctionKeywordsSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\MultiLineFunctionDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\ForLoopDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\LowercaseDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\ControlSignatureSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\SwitchDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\InlineIfDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\ForEachLoopDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\ElseIfDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\NamingConventions\ValidFunctionNameSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\NamingConventions\ValidVariableNameSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\PostStatementCommentSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\VariableCommentSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\ClosingDeclarationCommentSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\DocCommentAlignmentSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\LongConditionClosingCommentSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\InlineCommentSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\ClassCommentSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\FileCommentSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\EmptyCatchCommentSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\FunctionCommentThrowTagSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\BlockCommentSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Debug\JSLintSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Debug\JavaScriptLintSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Arrays\DisallowLongArraySyntaxSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis\EmptyStatementSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Commenting\TodoSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Commenting\DocCommentSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\ControlStructures\InlineControlStructureSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting\DisallowMultipleStatementsSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting\SpaceAfterCastSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Functions\FunctionCallArgumentSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions\ConstructorNameSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions\UpperCaseConstantNameSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DeprecatedFunctionsSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DisallowShortOpenTagSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\LowerCaseKeywordSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\LowerCaseConstantSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Strings\UnnecessaryStringConcatSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\DisallowTabIndentSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\LanguageConstructSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\IncrementDecrementSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\ScopeIndentSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PEAR\Sniffs\ControlStructures\MultiLineConditionSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PEAR\Sniffs\Files\IncludingFileSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PEAR\Sniffs\Formatting\MultiLineAssignmentSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PEAR\Sniffs\Functions\ValidDefaultValueSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR2\Sniffs\Files\EndFileNewlineSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Zend\Sniffs\Files\ClosingTagSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Zend\Sniffs\Debug\CodeAnalyzerSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\LineLengthSniff::class) - ->property('lineLimit', '120') - ->property('absoluteLineLimit', '0'); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\LineEndingsSniff::class) - ->property('eolChar', '\\n'); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting\MultipleStatementAlignmentSniff::class) - ->property('maxPadding', '20') - ->property('error', 'true'); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\ForbiddenFunctionsSniff::class) - ->property('forbiddenFunctions', [ +return static function (ECSConfig $containerConfigurator): void { + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\MySource\Sniffs\Strings\JoinStringsSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\MySource\Sniffs\CSS\BrowserSpecificStylesSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\MySource\Sniffs\Objects\CreateWidgetTypeCallbackSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\MySource\Sniffs\Objects\AssignThisSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\MySource\Sniffs\Objects\DisallowNewWidgetSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\MySource\Sniffs\PHP\EvalObjectFactorySniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\MySource\Sniffs\PHP\AjaxNullComparisonSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\MySource\Sniffs\PHP\GetRequestDataSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\MySource\Sniffs\PHP\ReturnFunctionValueSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\MySource\Sniffs\Commenting\FunctionCommentSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\MySource\Sniffs\Debug\FirebugConsoleSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\MySource\Sniffs\Debug\DebugCodeSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\MySource\Sniffs\Channels\DisallowSelfActionsSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\MySource\Sniffs\Channels\IncludeSystemSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\MySource\Sniffs\Channels\IncludeOwnSystemSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\MySource\Sniffs\Channels\UnusedSystemSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Strings\ConcatenationSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Strings\DoubleQuoteUsageSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Strings\EchoedStringsSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Operators\ComparisonOperatorUsageSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Operators\IncrementDecrementUsageSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Operators\ValidLogicalOperatorsSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\DisallowMultipleStyleDefinitionsSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\LowercaseStyleDefinitionSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\ClassDefinitionNameSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\OpacitySniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\ClassDefinitionOpeningBraceSpaceSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\ColonSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\ForbiddenStylesSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\NamedColoursSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\ClassDefinitionClosingBraceSpaceSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\ColourDefinitionSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\DuplicateClassDefinitionSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\EmptyStyleDefinitionSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\EmptyClassDefinitionSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\MissingColonSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\DuplicateStyleDefinitionSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\ShorthandSizeSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\SemicolonSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\IndentationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes\ValidClassNameSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes\DuplicatePropertySniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes\LowercaseClassKeywordsSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes\SelfMemberReferenceSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes\ClassFileNameSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes\ClassDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Objects\ObjectMemberCommaSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Objects\ObjectInstantiationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Objects\DisallowObjectStringIndexSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Scope\MemberVarScopeSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Scope\MethodScopeSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Scope\StaticThisUsageSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\HeredocSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\DisallowMultipleAssignmentsSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\InnerFunctionsSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\EvalSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\GlobalKeywordSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\DisallowBooleanStatementSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\DiscouragedFunctionsSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\CommentedOutCodeSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\LowercasePHPFunctionsSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\DisallowSizeFunctionsInLoopsSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\DisallowInlineIfSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\DisallowComparisonAssignmentSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\EmbeddedPhpSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\NonExecutableCodeSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\PropertyLabelSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\ControlStructureSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\FunctionSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\MemberVarSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\CastSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\FunctionClosingBraceSpaceSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\OperatorSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\ObjectOperatorSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\LogicalOperatorSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\ScopeClosingBraceSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\SuperfluousWhitespaceSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\LanguageConstructSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\FunctionOpeningBraceSpaceSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\ScopeKeywordSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\SemicolonSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Formatting\OperatorBracketSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Arrays\ArrayDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Arrays\ArrayBracketSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Files\FileExtensionSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\FunctionDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\GlobalFunctionSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\FunctionDeclarationArgumentSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\FunctionDuplicateArgumentSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\LowercaseFunctionKeywordsSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\MultiLineFunctionDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\ForLoopDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\LowercaseDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\ControlSignatureSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\SwitchDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\InlineIfDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\ForEachLoopDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\ElseIfDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\NamingConventions\ValidFunctionNameSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\NamingConventions\ValidVariableNameSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\PostStatementCommentSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\VariableCommentSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\ClosingDeclarationCommentSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\DocCommentAlignmentSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\LongConditionClosingCommentSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\InlineCommentSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\ClassCommentSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\FileCommentSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\EmptyCatchCommentSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\FunctionCommentThrowTagSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\BlockCommentSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Debug\JSLintSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Debug\JavaScriptLintSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Arrays\DisallowLongArraySyntaxSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis\EmptyStatementSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Commenting\TodoSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Commenting\DocCommentSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\ControlStructures\InlineControlStructureSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting\DisallowMultipleStatementsSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting\SpaceAfterCastSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Functions\FunctionCallArgumentSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions\ConstructorNameSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions\UpperCaseConstantNameSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DeprecatedFunctionsSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DisallowShortOpenTagSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\LowerCaseKeywordSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\LowerCaseConstantSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Strings\UnnecessaryStringConcatSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\DisallowTabIndentSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\LanguageConstructSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\IncrementDecrementSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\ScopeIndentSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PEAR\Sniffs\ControlStructures\MultiLineConditionSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PEAR\Sniffs\Files\IncludingFileSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PEAR\Sniffs\Formatting\MultiLineAssignmentSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PEAR\Sniffs\Functions\ValidDefaultValueSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR2\Sniffs\Files\EndFileNewlineSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Zend\Sniffs\Files\ClosingTagSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Zend\Sniffs\Debug\CodeAnalyzerSniff::class); + $containerConfigurator->ruleWithConfiguration(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\LineLengthSniff::class, [ + 'lineLimit' => '120', + 'absoluteLineLimit' => '0', + ]); + $containerConfigurator->ruleWithConfiguration(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\LineEndingsSniff::class, [ + 'eolChar' => '\\n', + ]); + $containerConfigurator->ruleWithConfiguration(\PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting\MultipleStatementAlignmentSniff::class, [ + 'maxPadding' => '20', + 'error' => 'true', + ]); + $containerConfigurator->ruleWithConfiguration(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\ForbiddenFunctionsSniff::class, [ + 'forbiddenFunctions' => [ 'sizeof' => 'count', 'delete' => 'unset', 'print' => 'echo', 'is_null' => 'null', 'create_function' => 'null', - ]); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Debug\ClosureLinterSniff::class) - ->property('errorCodes', ['0210']) - ->property('ignoreCodes', ['0001', '0110', '0240']); - $services->set(\PHP_CodeSniffer\Standards\PEAR\Sniffs\Functions\FunctionCallSignatureSniff::class) - ->property('allowMultipleArguments', 'false'); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Arrays\ArrayIndentSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR2\Sniffs\Methods\MethodDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR2\Sniffs\Classes\PropertyDeclarationSniff::class); + ], + ]); + $containerConfigurator->ruleWithConfiguration(\PHP_CodeSniffer\Standards\Generic\Sniffs\Debug\ClosureLinterSniff::class, [ + 'errorCodes' => ['0210'], + 'ignoreCodes' => ['0001', '0110', '0240'], + ]); + $containerConfigurator->ruleWithConfiguration(\PHP_CodeSniffer\Standards\PEAR\Sniffs\Functions\FunctionCallSignatureSniff::class, [ + 'allowMultipleArguments' => 'false', + ]); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Arrays\ArrayIndentSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR2\Sniffs\Methods\MethodDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR2\Sniffs\Classes\PropertyDeclarationSniff::class); }; diff --git a/config/set/php_codesniffer/pear.php b/config/set/php_codesniffer/pear.php index 3d91820..51ebfc2 100644 --- a/config/set/php_codesniffer/pear.php +++ b/config/set/php_codesniffer/pear.php @@ -2,40 +2,42 @@ declare(strict_types=1); -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Symplify\EasyCodingStandard\Config\ECSConfig; -return static function (ContainerConfigurator $containerConfigurator): void { - $services = $containerConfigurator->services(); - $services->set(\PHP_CodeSniffer\Standards\PEAR\Sniffs\Classes\ClassDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PEAR\Sniffs\WhiteSpace\ScopeIndentSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PEAR\Sniffs\WhiteSpace\ObjectOperatorIndentSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PEAR\Sniffs\WhiteSpace\ScopeClosingBraceSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PEAR\Sniffs\Formatting\MultiLineAssignmentSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PEAR\Sniffs\Files\IncludingFileSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PEAR\Sniffs\Functions\FunctionCallSignatureSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PEAR\Sniffs\Functions\FunctionDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PEAR\Sniffs\Functions\ValidDefaultValueSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PEAR\Sniffs\ControlStructures\ControlSignatureSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PEAR\Sniffs\ControlStructures\MultiLineConditionSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PEAR\Sniffs\NamingConventions\ValidClassNameSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PEAR\Sniffs\NamingConventions\ValidFunctionNameSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PEAR\Sniffs\NamingConventions\ValidVariableNameSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PEAR\Sniffs\Commenting\FunctionCommentSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PEAR\Sniffs\Commenting\InlineCommentSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PEAR\Sniffs\Commenting\ClassCommentSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PEAR\Sniffs\Commenting\FileCommentSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Functions\FunctionCallArgumentSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions\UpperCaseConstantNameSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\LowerCaseConstantSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DisallowShortOpenTagSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\DisallowTabIndentSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Commenting\DocCommentSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\DocCommentAlignmentSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\LineLengthSniff::class) - ->property('lineLimit', '85') - ->property('absoluteLineLimit', '0'); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\LineEndingsSniff::class) - ->property('eolChar', '\\n'); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\ControlStructures\InlineControlStructureSniff::class) - ->property('error', 'false'); +return static function (ECSConfig $containerConfigurator): void { + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PEAR\Sniffs\Classes\ClassDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PEAR\Sniffs\WhiteSpace\ScopeIndentSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PEAR\Sniffs\WhiteSpace\ObjectOperatorIndentSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PEAR\Sniffs\WhiteSpace\ScopeClosingBraceSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PEAR\Sniffs\Formatting\MultiLineAssignmentSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PEAR\Sniffs\Files\IncludingFileSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PEAR\Sniffs\Functions\FunctionCallSignatureSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PEAR\Sniffs\Functions\FunctionDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PEAR\Sniffs\Functions\ValidDefaultValueSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PEAR\Sniffs\ControlStructures\ControlSignatureSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PEAR\Sniffs\ControlStructures\MultiLineConditionSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PEAR\Sniffs\NamingConventions\ValidClassNameSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PEAR\Sniffs\NamingConventions\ValidFunctionNameSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PEAR\Sniffs\NamingConventions\ValidVariableNameSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PEAR\Sniffs\Commenting\FunctionCommentSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PEAR\Sniffs\Commenting\InlineCommentSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PEAR\Sniffs\Commenting\ClassCommentSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PEAR\Sniffs\Commenting\FileCommentSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Functions\FunctionCallArgumentSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions\UpperCaseConstantNameSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\LowerCaseConstantSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DisallowShortOpenTagSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\DisallowTabIndentSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Commenting\DocCommentSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\DocCommentAlignmentSniff::class); + $containerConfigurator->ruleWithConfiguration(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\LineLengthSniff::class, [ + 'lineLimit' => '85', + 'absoluteLineLimit' => '0', + ]); + $containerConfigurator->ruleWithConfiguration(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\LineEndingsSniff::class, [ + 'eolChar' => '\\n', + ]); + $containerConfigurator->ruleWithConfiguration(\PHP_CodeSniffer\Standards\Generic\Sniffs\ControlStructures\InlineControlStructureSniff::class, [ + 'error' => 'false', + ]); }; diff --git a/config/set/php_codesniffer/psr1.php b/config/set/php_codesniffer/psr1.php index a0c0df8..6adf003 100644 --- a/config/set/php_codesniffer/psr1.php +++ b/config/set/php_codesniffer/psr1.php @@ -2,16 +2,15 @@ declare(strict_types=1); -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Symplify\EasyCodingStandard\Config\ECSConfig; -return static function (ContainerConfigurator $containerConfigurator): void { - $services = $containerConfigurator->services(); - $services->set(\PHP_CodeSniffer\Standards\PSR1\Sniffs\Methods\CamelCapsMethodNameSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR1\Sniffs\Classes\ClassDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR1\Sniffs\Files\SideEffectsSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DisallowAlternativePHPTagsSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DisallowShortOpenTagSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\ByteOrderMarkSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes\ValidClassNameSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions\UpperCaseConstantNameSniff::class); +return static function (ECSConfig $containerConfigurator): void { + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR1\Sniffs\Methods\CamelCapsMethodNameSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR1\Sniffs\Classes\ClassDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR1\Sniffs\Files\SideEffectsSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DisallowAlternativePHPTagsSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DisallowShortOpenTagSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\ByteOrderMarkSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes\ValidClassNameSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions\UpperCaseConstantNameSniff::class); }; diff --git a/config/set/php_codesniffer/psr12.php b/config/set/php_codesniffer/psr12.php index dcc9de6..d5ebf2c 100644 --- a/config/set/php_codesniffer/psr12.php +++ b/config/set/php_codesniffer/psr12.php @@ -2,74 +2,78 @@ declare(strict_types=1); -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Symplify\EasyCodingStandard\Config\ECSConfig; -return static function (ContainerConfigurator $containerConfigurator): void { - $services = $containerConfigurator->services(); - $services->set(\PHP_CodeSniffer\Standards\PSR12\Sniffs\Operators\OperatorSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR12\Sniffs\Traits\UseDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR12\Sniffs\Classes\OpeningBraceSpaceSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR12\Sniffs\Classes\ClosingBraceSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR12\Sniffs\Classes\AnonClassDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR12\Sniffs\Classes\ClassInstantiationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR12\Sniffs\Namespaces\CompoundNamespaceDepthSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR12\Sniffs\Properties\ConstantVisibilitySniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR12\Sniffs\Files\ImportStatementSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR12\Sniffs\Files\FileHeaderSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR12\Sniffs\Files\OpenTagSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR12\Sniffs\Files\DeclareStatementSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR12\Sniffs\Functions\NullableTypeDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR12\Sniffs\Functions\ReturnTypeDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR12\Sniffs\ControlStructures\ControlStructureSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR12\Sniffs\ControlStructures\BooleanOperatorPlacementSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR12\Sniffs\Keywords\ShortFormTypeKeywordsSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR1\Sniffs\Methods\CamelCapsMethodNameSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR1\Sniffs\Classes\ClassDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR1\Sniffs\Files\SideEffectsSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DisallowAlternativePHPTagsSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DisallowShortOpenTagSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\ByteOrderMarkSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes\ValidClassNameSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions\UpperCaseConstantNameSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\LineEndingsSniff::class) - ->property('eolChar', '\\n'); - $services->set(\PHP_CodeSniffer\Standards\PSR2\Sniffs\Files\EndFileNewlineSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR2\Sniffs\Files\ClosingTagSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\LineLengthSniff::class) - ->property('lineLimit', '120') - ->property('absoluteLineLimit', '0'); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\SuperfluousWhitespaceSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting\DisallowMultipleStatementsSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\ScopeIndentSniff::class) - ->property('ignoreIndentationTokens', ['T_COMMENT', 'T_DOC_COMMENT_OPEN_TAG']); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\DisallowTabIndentSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\LowerCaseKeywordSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\LowerCaseConstantSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\LowerCaseTypeSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR2\Sniffs\Classes\ClassDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR2\Sniffs\Classes\PropertyDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Scope\MethodScopeSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\ScopeKeywordSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR2\Sniffs\Methods\MethodDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR2\Sniffs\Methods\FunctionClosingBraceSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\FunctionDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\LowercaseFunctionKeywordsSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\FunctionDeclarationArgumentSpacingSniff::class) - ->property('equalsSpacing', '1'); - $services->set(\PHP_CodeSniffer\Standards\PEAR\Sniffs\Functions\ValidDefaultValueSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\MultiLineFunctionDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Functions\FunctionCallArgumentSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR2\Sniffs\Methods\FunctionCallSignatureSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\ControlSignatureSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\ControlStructureSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\ScopeClosingBraceSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\ForEachLoopDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\ForLoopDeclarationSniff::class) - ->property('ignoreNewlines', 'true'); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\LowercaseDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\ControlStructures\InlineControlStructureSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR2\Sniffs\ControlStructures\ElseIfDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR2\Sniffs\ControlStructures\SwitchDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\IncrementDecrementSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\CastSpacingSniff::class); +return static function (ECSConfig $containerConfigurator): void { + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR12\Sniffs\Operators\OperatorSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR12\Sniffs\Traits\UseDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR12\Sniffs\Classes\OpeningBraceSpaceSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR12\Sniffs\Classes\ClosingBraceSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR12\Sniffs\Classes\AnonClassDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR12\Sniffs\Classes\ClassInstantiationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR12\Sniffs\Namespaces\CompoundNamespaceDepthSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR12\Sniffs\Properties\ConstantVisibilitySniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR12\Sniffs\Files\ImportStatementSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR12\Sniffs\Files\FileHeaderSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR12\Sniffs\Files\OpenTagSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR12\Sniffs\Files\DeclareStatementSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR12\Sniffs\Functions\NullableTypeDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR12\Sniffs\Functions\ReturnTypeDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR12\Sniffs\ControlStructures\ControlStructureSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR12\Sniffs\ControlStructures\BooleanOperatorPlacementSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR12\Sniffs\Keywords\ShortFormTypeKeywordsSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR1\Sniffs\Methods\CamelCapsMethodNameSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR1\Sniffs\Classes\ClassDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR1\Sniffs\Files\SideEffectsSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DisallowAlternativePHPTagsSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DisallowShortOpenTagSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\ByteOrderMarkSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes\ValidClassNameSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions\UpperCaseConstantNameSniff::class); + $containerConfigurator->ruleWithConfiguration(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\LineEndingsSniff::class, [ + 'eolChar' => '\\n', + ]); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR2\Sniffs\Files\EndFileNewlineSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR2\Sniffs\Files\ClosingTagSniff::class); + $containerConfigurator->ruleWithConfiguration(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\LineLengthSniff::class, [ + 'lineLimit' => '120', + 'absoluteLineLimit' => '0', + ]); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\SuperfluousWhitespaceSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting\DisallowMultipleStatementsSniff::class); + $containerConfigurator->ruleWithConfiguration(\PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\ScopeIndentSniff::class, [ + 'ignoreIndentationTokens' => ['T_COMMENT', 'T_DOC_COMMENT_OPEN_TAG'], + ]); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\DisallowTabIndentSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\LowerCaseKeywordSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\LowerCaseConstantSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\LowerCaseTypeSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR2\Sniffs\Classes\ClassDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR2\Sniffs\Classes\PropertyDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Scope\MethodScopeSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\ScopeKeywordSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR2\Sniffs\Methods\MethodDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR2\Sniffs\Methods\FunctionClosingBraceSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\FunctionDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\LowercaseFunctionKeywordsSniff::class); + $containerConfigurator->ruleWithConfiguration(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\FunctionDeclarationArgumentSpacingSniff::class, [ + 'equalsSpacing' => '1', + ]); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PEAR\Sniffs\Functions\ValidDefaultValueSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\MultiLineFunctionDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Functions\FunctionCallArgumentSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR2\Sniffs\Methods\FunctionCallSignatureSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\ControlSignatureSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\ControlStructureSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\ScopeClosingBraceSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\ForEachLoopDeclarationSniff::class); + $containerConfigurator->ruleWithConfiguration(\PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\ForLoopDeclarationSniff::class, [ + 'ignoreNewlines' => 'true', + ]); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\LowercaseDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\ControlStructures\InlineControlStructureSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR2\Sniffs\ControlStructures\ElseIfDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR2\Sniffs\ControlStructures\SwitchDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\IncrementDecrementSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\CastSpacingSniff::class); }; diff --git a/config/set/php_codesniffer/psr2.php b/config/set/php_codesniffer/psr2.php index 9d73b1c..fbcf6ee 100644 --- a/config/set/php_codesniffer/psr2.php +++ b/config/set/php_codesniffer/psr2.php @@ -2,57 +2,61 @@ declare(strict_types=1); -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Symplify\EasyCodingStandard\Config\ECSConfig; -return static function (ContainerConfigurator $containerConfigurator): void { - $services = $containerConfigurator->services(); - $services->set(\PHP_CodeSniffer\Standards\PSR2\Sniffs\Methods\FunctionCallSignatureSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR2\Sniffs\Methods\MethodDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR2\Sniffs\Methods\FunctionClosingBraceSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR2\Sniffs\Classes\PropertyDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR2\Sniffs\Classes\ClassDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR2\Sniffs\Namespaces\UseDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR2\Sniffs\Namespaces\NamespaceDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR2\Sniffs\Files\ClosingTagSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR2\Sniffs\Files\EndFileNewlineSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR2\Sniffs\ControlStructures\ControlStructureSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR2\Sniffs\ControlStructures\SwitchDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR2\Sniffs\ControlStructures\ElseIfDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR1\Sniffs\Methods\CamelCapsMethodNameSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR1\Sniffs\Classes\ClassDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR1\Sniffs\Files\SideEffectsSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DisallowAlternativePHPTagsSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DisallowShortOpenTagSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\ByteOrderMarkSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes\ValidClassNameSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions\UpperCaseConstantNameSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\LineEndingsSniff::class) - ->property('eolChar', '\\n'); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\LineLengthSniff::class) - ->property('lineLimit', '120') - ->property('absoluteLineLimit', '0'); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\SuperfluousWhitespaceSniff::class) - ->property('ignoreBlankLines', 'true'); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting\DisallowMultipleStatementsSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\ScopeIndentSniff::class) - ->property('ignoreIndentationTokens', ['T_COMMENT', 'T_DOC_COMMENT_OPEN_TAG']); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\DisallowTabIndentSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\LowerCaseKeywordSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\LowerCaseConstantSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Scope\MethodScopeSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\ScopeKeywordSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\FunctionDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\LowercaseFunctionKeywordsSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\FunctionDeclarationArgumentSpacingSniff::class) - ->property('equalsSpacing', '1'); - $services->set(\PHP_CodeSniffer\Standards\PEAR\Sniffs\Functions\ValidDefaultValueSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\MultiLineFunctionDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Functions\FunctionCallArgumentSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\ControlSignatureSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\ControlStructureSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\ScopeClosingBraceSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\ForEachLoopDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\ForLoopDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\LowercaseDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\ControlStructures\InlineControlStructureSniff::class); +return static function (ECSConfig $containerConfigurator): void { + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR2\Sniffs\Methods\FunctionCallSignatureSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR2\Sniffs\Methods\MethodDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR2\Sniffs\Methods\FunctionClosingBraceSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR2\Sniffs\Classes\PropertyDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR2\Sniffs\Classes\ClassDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR2\Sniffs\Namespaces\UseDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR2\Sniffs\Namespaces\NamespaceDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR2\Sniffs\Files\ClosingTagSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR2\Sniffs\Files\EndFileNewlineSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR2\Sniffs\ControlStructures\ControlStructureSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR2\Sniffs\ControlStructures\SwitchDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR2\Sniffs\ControlStructures\ElseIfDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR1\Sniffs\Methods\CamelCapsMethodNameSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR1\Sniffs\Classes\ClassDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR1\Sniffs\Files\SideEffectsSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DisallowAlternativePHPTagsSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DisallowShortOpenTagSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\ByteOrderMarkSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes\ValidClassNameSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions\UpperCaseConstantNameSniff::class); + $containerConfigurator->ruleWithConfiguration(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\LineEndingsSniff::class, [ + 'eolChar' => '\\n', + ]); + $containerConfigurator->ruleWithConfiguration(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\LineLengthSniff::class, [ + 'lineLimit' => '120', + 'absoluteLineLimit' => '0', + ]); + $containerConfigurator->ruleWithConfiguration(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\SuperfluousWhitespaceSniff::class, [ + 'ignoreBlankLines' => 'true', + ]); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting\DisallowMultipleStatementsSniff::class); + $containerConfigurator->ruleWithConfiguration(\PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\ScopeIndentSniff::class, [ + 'ignoreIndentationTokens' => ['T_COMMENT', 'T_DOC_COMMENT_OPEN_TAG'], + ]); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\DisallowTabIndentSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\LowerCaseKeywordSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\LowerCaseConstantSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Scope\MethodScopeSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\ScopeKeywordSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\FunctionDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\LowercaseFunctionKeywordsSniff::class); + $containerConfigurator->ruleWithConfiguration(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\FunctionDeclarationArgumentSpacingSniff::class, [ + 'equalsSpacing' => '1', + ]); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PEAR\Sniffs\Functions\ValidDefaultValueSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\MultiLineFunctionDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Functions\FunctionCallArgumentSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\ControlSignatureSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\ControlStructureSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\ScopeClosingBraceSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\ForEachLoopDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\ForLoopDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\LowercaseDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\ControlStructures\InlineControlStructureSniff::class); }; diff --git a/config/set/php_codesniffer/slevomat-coding-standard.php b/config/set/php_codesniffer/slevomat-coding-standard.php index 26252ae..403353e 100644 --- a/config/set/php_codesniffer/slevomat-coding-standard.php +++ b/config/set/php_codesniffer/slevomat-coding-standard.php @@ -2,152 +2,151 @@ declare(strict_types=1); -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Symplify\EasyCodingStandard\Config\ECSConfig; -return static function (ContainerConfigurator $containerConfigurator): void { - $services = $containerConfigurator->services(); - $services->set(\SlevomatCodingStandard\Sniffs\Numbers\DisallowNumericLiteralSeparatorSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Numbers\RequireNumericLiteralSeparatorSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Operators\DisallowEqualOperatorsSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Operators\NegationOperatorSpacingSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Operators\SpreadOperatorSpacingSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Operators\DisallowIncrementAndDecrementOperatorsSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Operators\RequireOnlyStandaloneIncrementAndDecrementOperatorsSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Operators\RequireCombinedAssignmentOperatorSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Classes\ClassMemberSpacingSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Classes\ForbiddenPublicPropertySniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Classes\ClassStructureSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Classes\RequireMultiLineMethodSignatureSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Classes\ConstantSpacingSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Classes\TraitUseSpacingSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Classes\SuperfluousErrorNamingSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Classes\ParentCallSpacingSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Classes\EmptyLinesAroundClassBracesSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Classes\SuperfluousInterfaceNamingSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Classes\SuperfluousTraitNamingSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Classes\SuperfluousAbstractClassNamingSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Classes\DisallowMultiConstantDefinitionSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Classes\ModernClassNameReferenceSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Classes\RequireConstructorPropertyPromotionSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Classes\UselessLateStaticBindingSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Classes\RequireSingleLineMethodSignatureSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Classes\DisallowMultiPropertyDefinitionSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Classes\PropertySpacingSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Classes\SuperfluousExceptionNamingSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Classes\ClassConstantVisibilitySniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Classes\RequireAbstractOrFinalSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Classes\MethodSpacingSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Classes\DisallowLateStaticBindingForConstantsSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Classes\DisallowConstructorPropertyPromotionSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Classes\TraitUseDeclarationSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Whitespaces\DuplicateSpacesSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\PHP\DisallowDirectMagicInvokeCallSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\PHP\RequireNowdocSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\PHP\TypeCastSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\PHP\RequireExplicitAssertionSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\PHP\ForbiddenClassesSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\PHP\ShortListSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\PHP\ReferenceSpacingSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\PHP\OptimizedFunctionsWithoutUnpackingSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\PHP\UselessParenthesesSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\PHP\DisallowReferenceSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\PHP\UselessSemicolonSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Exceptions\DeadCatchSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Exceptions\DisallowNonCapturingCatchSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Exceptions\RequireNonCapturingCatchSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Exceptions\ReferenceThrowableOnlySniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Namespaces\UselessAliasSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Namespaces\ReferenceUsedNamesOnlySniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Namespaces\FullyQualifiedClassNameInAnnotationSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Namespaces\UseDoesNotStartWithBackslashSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Namespaces\AlphabeticallySortedUsesSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Namespaces\FullyQualifiedGlobalConstantsSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Namespaces\FullyQualifiedGlobalFunctionsSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Namespaces\MultipleUsesPerLineSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Namespaces\UnusedUsesSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Namespaces\DisallowGroupUseSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Namespaces\UseSpacingSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Namespaces\NamespaceSpacingSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Namespaces\NamespaceDeclarationSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Namespaces\RequireOneNamespaceInFileSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Namespaces\UseFromSameNamespaceSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Namespaces\UseOnlyWhitelistedNamespacesSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Namespaces\FullyQualifiedExceptionsSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Variables\UselessVariableSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Variables\DisallowSuperGlobalVariableSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Variables\UnusedVariableSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Variables\DuplicateAssignmentToVariableSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Arrays\MultiLineArrayEndBracketPlacementSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Arrays\DisallowImplicitArrayCreationSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Arrays\SingleLineArrayWhitespaceSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Arrays\TrailingArrayCommaSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Files\LineLengthSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Files\FunctionLengthSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Files\TypeNameMatchesFileNameSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Functions\StrictCallSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Functions\RequireTrailingCommaInCallSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Functions\DisallowNamedArgumentsSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Functions\FunctionLengthSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Functions\RequireArrowFunctionSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Functions\RequireTrailingCommaInDeclarationSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Functions\DisallowEmptyFunctionSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Functions\RequireSingleLineCallSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Functions\UnusedInheritedVariablePassedToClosureSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Functions\DisallowTrailingCommaInDeclarationSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Functions\StaticClosureSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Functions\UselessParameterDefaultValueSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Functions\ArrowFunctionDeclarationSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Functions\RequireMultiLineCallSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Functions\DisallowTrailingCommaInCallSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Functions\DisallowArrowFunctionSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Functions\UnusedParameterSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\ControlStructures\RequireYodaComparisonSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\ControlStructures\RequireMultiLineConditionSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\ControlStructures\RequireNullCoalesceOperatorSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\ControlStructures\JumpStatementsSpacingSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\ControlStructures\RequireShortTernaryOperatorSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\ControlStructures\RequireSingleLineConditionSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\ControlStructures\RequireNullCoalesceEqualOperatorSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\ControlStructures\DisallowShortTernaryOperatorSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\ControlStructures\NewWithoutParenthesesSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\ControlStructures\RequireMultiLineTernaryOperatorSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\ControlStructures\NewWithParenthesesSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\ControlStructures\RequireTernaryOperatorSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\ControlStructures\UselessTernaryOperatorSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\ControlStructures\BlockControlStructureSpacingSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\ControlStructures\EarlyExitSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\ControlStructures\DisallowContinueWithoutIntegerOperandInSwitchSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\ControlStructures\AssignmentInConditionSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\ControlStructures\RequireNullSafeObjectOperatorSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\ControlStructures\DisallowEmptySniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\ControlStructures\DisallowNullSafeObjectOperatorSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\ControlStructures\LanguageConstructWithParenthesesSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\ControlStructures\UselessIfConditionWithReturnSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\ControlStructures\DisallowYodaComparisonSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\TypeHints\ParameterTypeHintSpacingSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\TypeHints\LongTypeHintsSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\TypeHints\ParameterTypeHintSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\TypeHints\UselessConstantTypeHintSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\TypeHints\NullTypeHintOnLastPositionSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\TypeHints\PropertyTypeHintSpacingSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\TypeHints\DisallowMixedTypeHintSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\TypeHints\UnionTypeHintFormatSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\TypeHints\PropertyTypeHintSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\TypeHints\DeclareStrictTypesSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\TypeHints\DisallowArrayTypeHintSyntaxSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\TypeHints\ReturnTypeHintSpacingSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\TypeHints\NullableTypeForNullDefaultValueSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\TypeHints\ReturnTypeHintSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Commenting\UselessInheritDocCommentSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Commenting\RequireOneLineDocCommentSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Commenting\ForbiddenAnnotationsSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Commenting\InlineDocCommentDeclarationSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Commenting\UselessFunctionDocCommentSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Commenting\RequireOneLinePropertyDocCommentSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Commenting\DocCommentSpacingSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Commenting\DisallowCommentAfterCodeSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Commenting\ForbiddenCommentsSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Commenting\DeprecatedAnnotationDeclarationSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Commenting\EmptyCommentSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Commenting\DisallowOneLinePropertyDocCommentSniff::class); +return static function (ECSConfig $containerConfigurator): void { + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Numbers\DisallowNumericLiteralSeparatorSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Numbers\RequireNumericLiteralSeparatorSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Operators\DisallowEqualOperatorsSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Operators\NegationOperatorSpacingSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Operators\SpreadOperatorSpacingSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Operators\DisallowIncrementAndDecrementOperatorsSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Operators\RequireOnlyStandaloneIncrementAndDecrementOperatorsSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Operators\RequireCombinedAssignmentOperatorSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Classes\ClassMemberSpacingSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Classes\ForbiddenPublicPropertySniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Classes\ClassStructureSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Classes\RequireMultiLineMethodSignatureSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Classes\ConstantSpacingSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Classes\TraitUseSpacingSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Classes\SuperfluousErrorNamingSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Classes\ParentCallSpacingSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Classes\EmptyLinesAroundClassBracesSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Classes\SuperfluousInterfaceNamingSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Classes\SuperfluousTraitNamingSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Classes\SuperfluousAbstractClassNamingSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Classes\DisallowMultiConstantDefinitionSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Classes\ModernClassNameReferenceSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Classes\RequireConstructorPropertyPromotionSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Classes\UselessLateStaticBindingSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Classes\RequireSingleLineMethodSignatureSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Classes\DisallowMultiPropertyDefinitionSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Classes\PropertySpacingSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Classes\SuperfluousExceptionNamingSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Classes\ClassConstantVisibilitySniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Classes\RequireAbstractOrFinalSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Classes\MethodSpacingSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Classes\DisallowLateStaticBindingForConstantsSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Classes\DisallowConstructorPropertyPromotionSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Classes\TraitUseDeclarationSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Whitespaces\DuplicateSpacesSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\PHP\DisallowDirectMagicInvokeCallSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\PHP\RequireNowdocSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\PHP\TypeCastSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\PHP\RequireExplicitAssertionSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\PHP\ForbiddenClassesSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\PHP\ShortListSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\PHP\ReferenceSpacingSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\PHP\OptimizedFunctionsWithoutUnpackingSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\PHP\UselessParenthesesSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\PHP\DisallowReferenceSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\PHP\UselessSemicolonSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Exceptions\DeadCatchSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Exceptions\DisallowNonCapturingCatchSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Exceptions\RequireNonCapturingCatchSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Exceptions\ReferenceThrowableOnlySniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Namespaces\UselessAliasSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Namespaces\ReferenceUsedNamesOnlySniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Namespaces\FullyQualifiedClassNameInAnnotationSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Namespaces\UseDoesNotStartWithBackslashSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Namespaces\AlphabeticallySortedUsesSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Namespaces\FullyQualifiedGlobalConstantsSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Namespaces\FullyQualifiedGlobalFunctionsSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Namespaces\MultipleUsesPerLineSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Namespaces\UnusedUsesSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Namespaces\DisallowGroupUseSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Namespaces\UseSpacingSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Namespaces\NamespaceSpacingSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Namespaces\NamespaceDeclarationSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Namespaces\RequireOneNamespaceInFileSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Namespaces\UseFromSameNamespaceSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Namespaces\UseOnlyWhitelistedNamespacesSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Namespaces\FullyQualifiedExceptionsSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Variables\UselessVariableSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Variables\DisallowSuperGlobalVariableSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Variables\UnusedVariableSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Variables\DuplicateAssignmentToVariableSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Arrays\MultiLineArrayEndBracketPlacementSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Arrays\DisallowImplicitArrayCreationSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Arrays\SingleLineArrayWhitespaceSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Arrays\TrailingArrayCommaSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Files\LineLengthSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Files\FunctionLengthSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Files\TypeNameMatchesFileNameSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Functions\StrictCallSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Functions\RequireTrailingCommaInCallSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Functions\DisallowNamedArgumentsSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Functions\FunctionLengthSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Functions\RequireArrowFunctionSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Functions\RequireTrailingCommaInDeclarationSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Functions\DisallowEmptyFunctionSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Functions\RequireSingleLineCallSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Functions\UnusedInheritedVariablePassedToClosureSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Functions\DisallowTrailingCommaInDeclarationSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Functions\StaticClosureSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Functions\UselessParameterDefaultValueSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Functions\ArrowFunctionDeclarationSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Functions\RequireMultiLineCallSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Functions\DisallowTrailingCommaInCallSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Functions\DisallowArrowFunctionSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Functions\UnusedParameterSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\ControlStructures\RequireYodaComparisonSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\ControlStructures\RequireMultiLineConditionSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\ControlStructures\RequireNullCoalesceOperatorSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\ControlStructures\JumpStatementsSpacingSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\ControlStructures\RequireShortTernaryOperatorSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\ControlStructures\RequireSingleLineConditionSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\ControlStructures\RequireNullCoalesceEqualOperatorSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\ControlStructures\DisallowShortTernaryOperatorSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\ControlStructures\NewWithoutParenthesesSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\ControlStructures\RequireMultiLineTernaryOperatorSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\ControlStructures\NewWithParenthesesSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\ControlStructures\RequireTernaryOperatorSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\ControlStructures\UselessTernaryOperatorSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\ControlStructures\BlockControlStructureSpacingSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\ControlStructures\EarlyExitSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\ControlStructures\DisallowContinueWithoutIntegerOperandInSwitchSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\ControlStructures\AssignmentInConditionSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\ControlStructures\RequireNullSafeObjectOperatorSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\ControlStructures\DisallowEmptySniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\ControlStructures\DisallowNullSafeObjectOperatorSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\ControlStructures\LanguageConstructWithParenthesesSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\ControlStructures\UselessIfConditionWithReturnSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\ControlStructures\DisallowYodaComparisonSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\TypeHints\ParameterTypeHintSpacingSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\TypeHints\LongTypeHintsSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\TypeHints\ParameterTypeHintSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\TypeHints\UselessConstantTypeHintSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\TypeHints\NullTypeHintOnLastPositionSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\TypeHints\PropertyTypeHintSpacingSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\TypeHints\DisallowMixedTypeHintSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\TypeHints\UnionTypeHintFormatSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\TypeHints\PropertyTypeHintSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\TypeHints\DeclareStrictTypesSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\TypeHints\DisallowArrayTypeHintSyntaxSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\TypeHints\ReturnTypeHintSpacingSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\TypeHints\NullableTypeForNullDefaultValueSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\TypeHints\ReturnTypeHintSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Commenting\UselessInheritDocCommentSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Commenting\RequireOneLineDocCommentSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Commenting\ForbiddenAnnotationsSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Commenting\InlineDocCommentDeclarationSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Commenting\UselessFunctionDocCommentSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Commenting\RequireOneLinePropertyDocCommentSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Commenting\DocCommentSpacingSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Commenting\DisallowCommentAfterCodeSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Commenting\ForbiddenCommentsSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Commenting\DeprecatedAnnotationDeclarationSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Commenting\EmptyCommentSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Commenting\DisallowOneLinePropertyDocCommentSniff::class); }; diff --git a/config/set/php_codesniffer/squiz.php b/config/set/php_codesniffer/squiz.php index 16fe7a6..8bc67c0 100644 --- a/config/set/php_codesniffer/squiz.php +++ b/config/set/php_codesniffer/squiz.php @@ -2,156 +2,161 @@ declare(strict_types=1); -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Symplify\EasyCodingStandard\Config\ECSConfig; -return static function (ContainerConfigurator $containerConfigurator): void { - $services = $containerConfigurator->services(); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Strings\ConcatenationSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Strings\DoubleQuoteUsageSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Strings\EchoedStringsSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Operators\ComparisonOperatorUsageSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Operators\IncrementDecrementUsageSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Operators\ValidLogicalOperatorsSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\DisallowMultipleStyleDefinitionsSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\LowercaseStyleDefinitionSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\ClassDefinitionNameSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\OpacitySniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\ClassDefinitionOpeningBraceSpaceSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\ColonSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\ForbiddenStylesSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\NamedColoursSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\ClassDefinitionClosingBraceSpaceSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\ColourDefinitionSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\DuplicateClassDefinitionSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\EmptyStyleDefinitionSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\EmptyClassDefinitionSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\MissingColonSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\DuplicateStyleDefinitionSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\ShorthandSizeSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\SemicolonSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\IndentationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes\ValidClassNameSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes\DuplicatePropertySniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes\LowercaseClassKeywordsSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes\SelfMemberReferenceSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes\ClassFileNameSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes\ClassDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Objects\ObjectMemberCommaSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Objects\ObjectInstantiationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Objects\DisallowObjectStringIndexSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Scope\MemberVarScopeSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Scope\MethodScopeSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Scope\StaticThisUsageSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\HeredocSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\DisallowMultipleAssignmentsSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\InnerFunctionsSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\EvalSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\GlobalKeywordSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\DisallowBooleanStatementSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\DiscouragedFunctionsSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\CommentedOutCodeSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\LowercasePHPFunctionsSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\DisallowSizeFunctionsInLoopsSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\DisallowInlineIfSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\DisallowComparisonAssignmentSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\EmbeddedPhpSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\NonExecutableCodeSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\PropertyLabelSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\ControlStructureSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\FunctionSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\MemberVarSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\CastSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\FunctionClosingBraceSpaceSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\OperatorSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\ObjectOperatorSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\LogicalOperatorSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\ScopeClosingBraceSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\SuperfluousWhitespaceSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\LanguageConstructSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\FunctionOpeningBraceSpaceSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\ScopeKeywordSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\SemicolonSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Formatting\OperatorBracketSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Arrays\ArrayDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Arrays\ArrayBracketSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Files\FileExtensionSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\FunctionDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\GlobalFunctionSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\FunctionDeclarationArgumentSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\FunctionDuplicateArgumentSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\LowercaseFunctionKeywordsSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\MultiLineFunctionDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\ForLoopDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\LowercaseDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\ControlSignatureSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\SwitchDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\InlineIfDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\ForEachLoopDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\ElseIfDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\NamingConventions\ValidFunctionNameSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\NamingConventions\ValidVariableNameSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\PostStatementCommentSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\VariableCommentSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\ClosingDeclarationCommentSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\DocCommentAlignmentSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\LongConditionClosingCommentSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\FunctionCommentSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\InlineCommentSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\ClassCommentSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\FileCommentSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\EmptyCatchCommentSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\FunctionCommentThrowTagSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\BlockCommentSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Debug\JSLintSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Debug\JavaScriptLintSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Arrays\DisallowLongArraySyntaxSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis\EmptyStatementSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Commenting\TodoSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Commenting\DocCommentSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\ControlStructures\InlineControlStructureSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting\DisallowMultipleStatementsSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting\SpaceAfterCastSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Functions\FunctionCallArgumentSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions\ConstructorNameSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions\UpperCaseConstantNameSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DeprecatedFunctionsSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DisallowShortOpenTagSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\LowerCaseKeywordSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\LowerCaseConstantSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Strings\UnnecessaryStringConcatSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\DisallowTabIndentSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\LanguageConstructSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\IncrementDecrementSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\ScopeIndentSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PEAR\Sniffs\ControlStructures\MultiLineConditionSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PEAR\Sniffs\Files\IncludingFileSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PEAR\Sniffs\Formatting\MultiLineAssignmentSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PEAR\Sniffs\Functions\ValidDefaultValueSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR2\Sniffs\Files\EndFileNewlineSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Zend\Sniffs\Files\ClosingTagSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Zend\Sniffs\Debug\CodeAnalyzerSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\LineLengthSniff::class) - ->property('lineLimit', '120') - ->property('absoluteLineLimit', '0'); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\LineEndingsSniff::class) - ->property('eolChar', '\\n'); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting\MultipleStatementAlignmentSniff::class) - ->property('maxPadding', '20') - ->property('error', 'true'); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\ForbiddenFunctionsSniff::class) - ->property('forbiddenFunctions', [ +return static function (ECSConfig $containerConfigurator): void { + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Strings\ConcatenationSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Strings\DoubleQuoteUsageSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Strings\EchoedStringsSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Operators\ComparisonOperatorUsageSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Operators\IncrementDecrementUsageSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Operators\ValidLogicalOperatorsSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\DisallowMultipleStyleDefinitionsSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\LowercaseStyleDefinitionSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\ClassDefinitionNameSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\OpacitySniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\ClassDefinitionOpeningBraceSpaceSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\ColonSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\ForbiddenStylesSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\NamedColoursSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\ClassDefinitionClosingBraceSpaceSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\ColourDefinitionSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\DuplicateClassDefinitionSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\EmptyStyleDefinitionSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\EmptyClassDefinitionSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\MissingColonSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\DuplicateStyleDefinitionSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\ShorthandSizeSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\SemicolonSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\IndentationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes\ValidClassNameSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes\DuplicatePropertySniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes\LowercaseClassKeywordsSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes\SelfMemberReferenceSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes\ClassFileNameSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Classes\ClassDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Objects\ObjectMemberCommaSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Objects\ObjectInstantiationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Objects\DisallowObjectStringIndexSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Scope\MemberVarScopeSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Scope\MethodScopeSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Scope\StaticThisUsageSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\HeredocSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\DisallowMultipleAssignmentsSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\InnerFunctionsSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\EvalSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\GlobalKeywordSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\DisallowBooleanStatementSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\DiscouragedFunctionsSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\CommentedOutCodeSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\LowercasePHPFunctionsSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\DisallowSizeFunctionsInLoopsSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\DisallowInlineIfSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\DisallowComparisonAssignmentSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\EmbeddedPhpSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\PHP\NonExecutableCodeSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\PropertyLabelSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\ControlStructureSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\FunctionSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\MemberVarSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\CastSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\FunctionClosingBraceSpaceSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\OperatorSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\ObjectOperatorSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\LogicalOperatorSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\ScopeClosingBraceSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\SuperfluousWhitespaceSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\LanguageConstructSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\FunctionOpeningBraceSpaceSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\ScopeKeywordSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\SemicolonSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Formatting\OperatorBracketSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Arrays\ArrayDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Arrays\ArrayBracketSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Files\FileExtensionSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\FunctionDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\GlobalFunctionSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\FunctionDeclarationArgumentSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\FunctionDuplicateArgumentSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\LowercaseFunctionKeywordsSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\MultiLineFunctionDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\ForLoopDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\LowercaseDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\ControlSignatureSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\SwitchDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\InlineIfDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\ForEachLoopDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\ControlStructures\ElseIfDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\NamingConventions\ValidFunctionNameSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\NamingConventions\ValidVariableNameSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\PostStatementCommentSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\VariableCommentSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\ClosingDeclarationCommentSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\DocCommentAlignmentSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\LongConditionClosingCommentSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\FunctionCommentSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\InlineCommentSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\ClassCommentSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\FileCommentSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\EmptyCatchCommentSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\FunctionCommentThrowTagSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\BlockCommentSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Debug\JSLintSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Debug\JavaScriptLintSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Arrays\DisallowLongArraySyntaxSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis\EmptyStatementSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Commenting\TodoSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Commenting\DocCommentSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\ControlStructures\InlineControlStructureSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting\DisallowMultipleStatementsSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting\SpaceAfterCastSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Functions\FunctionCallArgumentSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions\ConstructorNameSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions\UpperCaseConstantNameSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DeprecatedFunctionsSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DisallowShortOpenTagSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\LowerCaseKeywordSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\LowerCaseConstantSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Strings\UnnecessaryStringConcatSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\DisallowTabIndentSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\LanguageConstructSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\IncrementDecrementSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\ScopeIndentSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PEAR\Sniffs\ControlStructures\MultiLineConditionSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PEAR\Sniffs\Files\IncludingFileSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PEAR\Sniffs\Formatting\MultiLineAssignmentSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PEAR\Sniffs\Functions\ValidDefaultValueSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR2\Sniffs\Files\EndFileNewlineSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Zend\Sniffs\Files\ClosingTagSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Zend\Sniffs\Debug\CodeAnalyzerSniff::class); + $containerConfigurator->ruleWithConfiguration(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\LineLengthSniff::class, [ + 'lineLimit' => '120', + 'absoluteLineLimit' => '0', + ]); + $containerConfigurator->ruleWithConfiguration(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\LineEndingsSniff::class, [ + 'eolChar' => '\\n', + ]); + $containerConfigurator->ruleWithConfiguration(\PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting\MultipleStatementAlignmentSniff::class, [ + 'maxPadding' => '20', + 'error' => 'true', + ]); + $containerConfigurator->ruleWithConfiguration(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\ForbiddenFunctionsSniff::class, [ + 'forbiddenFunctions' => [ 'sizeof' => 'count', 'delete' => 'unset', 'print' => 'echo', 'is_null' => 'null', 'create_function' => 'null', - ]); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Debug\ClosureLinterSniff::class) - ->property('errorCodes', ['0210']) - ->property('ignoreCodes', ['0001', '0110', '0240']); - $services->set(\PHP_CodeSniffer\Standards\PEAR\Sniffs\Functions\FunctionCallSignatureSniff::class) - ->property('allowMultipleArguments', 'false'); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Arrays\ArrayIndentSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR2\Sniffs\Methods\MethodDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PSR2\Sniffs\Classes\PropertyDeclarationSniff::class); + ], + ]); + $containerConfigurator->ruleWithConfiguration(\PHP_CodeSniffer\Standards\Generic\Sniffs\Debug\ClosureLinterSniff::class, [ + 'errorCodes' => ['0210'], + 'ignoreCodes' => ['0001', '0110', '0240'], + ]); + $containerConfigurator->ruleWithConfiguration(\PHP_CodeSniffer\Standards\PEAR\Sniffs\Functions\FunctionCallSignatureSniff::class, [ + 'allowMultipleArguments' => 'false', + ]); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Arrays\ArrayIndentSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR2\Sniffs\Methods\MethodDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PSR2\Sniffs\Classes\PropertyDeclarationSniff::class); }; diff --git a/config/set/php_codesniffer/zend.php b/config/set/php_codesniffer/zend.php index b986a45..27fdbfb 100644 --- a/config/set/php_codesniffer/zend.php +++ b/config/set/php_codesniffer/zend.php @@ -2,26 +2,27 @@ declare(strict_types=1); -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Symplify\EasyCodingStandard\Config\ECSConfig; -return static function (ContainerConfigurator $containerConfigurator): void { - $services = $containerConfigurator->services(); - $services->set(\PHP_CodeSniffer\Standards\Zend\Sniffs\Files\ClosingTagSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Zend\Sniffs\NamingConventions\ValidVariableNameSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Zend\Sniffs\Debug\CodeAnalyzerSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Functions\FunctionCallArgumentSpacingSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Functions\OpeningFunctionBraceBsdAllmanSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DisallowShortOpenTagSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\DisallowTabIndentSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PEAR\Sniffs\Classes\ClassDeclarationSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PEAR\Sniffs\ControlStructures\ControlSignatureSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PEAR\Sniffs\Functions\FunctionCallSignatureSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PEAR\Sniffs\Functions\ValidDefaultValueSniff::class); - $services->set(\PHP_CodeSniffer\Standards\PEAR\Sniffs\WhiteSpace\ScopeClosingBraceSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\GlobalFunctionSniff::class); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\LineLengthSniff::class) - ->property('lineLimit', '80') - ->property('absoluteLineLimit', '120'); - $services->set(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\LineEndingsSniff::class) - ->property('eolChar', '\\n'); +return static function (ECSConfig $containerConfigurator): void { + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Zend\Sniffs\Files\ClosingTagSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Zend\Sniffs\NamingConventions\ValidVariableNameSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Zend\Sniffs\Debug\CodeAnalyzerSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Functions\FunctionCallArgumentSpacingSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\Functions\OpeningFunctionBraceBsdAllmanSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DisallowShortOpenTagSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\DisallowTabIndentSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PEAR\Sniffs\Classes\ClassDeclarationSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PEAR\Sniffs\ControlStructures\ControlSignatureSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PEAR\Sniffs\Functions\FunctionCallSignatureSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PEAR\Sniffs\Functions\ValidDefaultValueSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\PEAR\Sniffs\WhiteSpace\ScopeClosingBraceSniff::class); + $containerConfigurator->rule(\PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\GlobalFunctionSniff::class); + $containerConfigurator->ruleWithConfiguration(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\LineLengthSniff::class, [ + 'lineLimit' => '80', + 'absoluteLineLimit' => '120', + ]); + $containerConfigurator->ruleWithConfiguration(\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\LineEndingsSniff::class, [ + 'eolChar' => '\\n', + ]); }; diff --git a/config/set/rector/faker114.php b/config/set/rector/faker114.php index e05d470..183f7ec 100644 --- a/config/set/rector/faker114.php +++ b/config/set/rector/faker114.php @@ -2,155 +2,153 @@ declare(strict_types=1); +use Rector\Config\RectorConfig; use Rector\Transform\Rector\Assign\PropertyFetchToMethodCallRector; use Rector\Transform\ValueObject\PropertyFetchToMethodCall; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { - $services = $containerConfigurator->services(); - $services->set(PropertyFetchToMethodCallRector::class) - ->configure([ - new PropertyFetchToMethodCall('Faker\Generator', 'citySuffix', 'citySuffix'), - new PropertyFetchToMethodCall('Faker\Generator', 'streetSuffix', 'streetSuffix'), - new PropertyFetchToMethodCall('Faker\Generator', 'buildingNumber', 'buildingNumber'), - new PropertyFetchToMethodCall('Faker\Generator', 'city', 'city'), - new PropertyFetchToMethodCall('Faker\Generator', 'streetName', 'streetName'), - new PropertyFetchToMethodCall('Faker\Generator', 'streetAddress', 'streetAddress'), - new PropertyFetchToMethodCall('Faker\Generator', 'postcode', 'postcode'), - new PropertyFetchToMethodCall('Faker\Generator', 'address', 'address'), - new PropertyFetchToMethodCall('Faker\Generator', 'country', 'country'), - new PropertyFetchToMethodCall('Faker\Generator', 'latitude', 'latitude'), - new PropertyFetchToMethodCall('Faker\Generator', 'longitude', 'longitude'), - new PropertyFetchToMethodCall('Faker\Generator', 'localCoordinates', 'localCoordinates'), - new PropertyFetchToMethodCall('Faker\Generator', 'randomDigitNotNull', 'randomDigitNotNull'), - new PropertyFetchToMethodCall('Faker\Generator', 'passthrough', 'passthrough'), - new PropertyFetchToMethodCall('Faker\Generator', 'randomLetter', 'randomLetter'), - new PropertyFetchToMethodCall('Faker\Generator', 'randomAscii', 'randomAscii'), - new PropertyFetchToMethodCall('Faker\Generator', 'randomElements', 'randomElements'), - new PropertyFetchToMethodCall('Faker\Generator', 'randomElement', 'randomElement'), - new PropertyFetchToMethodCall('Faker\Generator', 'randomKey', 'randomKey'), - new PropertyFetchToMethodCall('Faker\Generator', 'shuffle', 'shuffle'), - new PropertyFetchToMethodCall('Faker\Generator', 'shuffleArray', 'shuffleArray'), - new PropertyFetchToMethodCall('Faker\Generator', 'shuffleString', 'shuffleString'), - new PropertyFetchToMethodCall('Faker\Generator', 'numerify', 'numerify'), - new PropertyFetchToMethodCall('Faker\Generator', 'lexify', 'lexify'), - new PropertyFetchToMethodCall('Faker\Generator', 'bothify', 'bothify'), - new PropertyFetchToMethodCall('Faker\Generator', 'asciify', 'asciify'), - new PropertyFetchToMethodCall('Faker\Generator', 'regexify', 'regexify'), - new PropertyFetchToMethodCall('Faker\Generator', 'toLower', 'toLower'), - new PropertyFetchToMethodCall('Faker\Generator', 'toUpper', 'toUpper'), - new PropertyFetchToMethodCall('Faker\Generator', 'optional', 'optional'), - new PropertyFetchToMethodCall('Faker\Generator', 'unique', 'unique'), - new PropertyFetchToMethodCall('Faker\Generator', 'valid', 'valid'), - new PropertyFetchToMethodCall('Faker\Generator', 'biasedNumberBetween', 'biasedNumberBetween'), - new PropertyFetchToMethodCall('Faker\Generator', 'hexColor', 'hexColor'), - new PropertyFetchToMethodCall('Faker\Generator', 'safeHexColor', 'safeHexColor'), - new PropertyFetchToMethodCall('Faker\Generator', 'rgbColorAsArray', 'rgbColorAsArray'), - new PropertyFetchToMethodCall('Faker\Generator', 'rgbColor', 'rgbColor'), - new PropertyFetchToMethodCall('Faker\Generator', 'rgbCssColor', 'rgbCssColor'), - new PropertyFetchToMethodCall('Faker\Generator', 'rgbaCssColor', 'rgbaCssColor'), - new PropertyFetchToMethodCall('Faker\Generator', 'safeColorName', 'safeColorName'), - new PropertyFetchToMethodCall('Faker\Generator', 'colorName', 'colorName'), - new PropertyFetchToMethodCall('Faker\Generator', 'hslColor', 'hslColor'), - new PropertyFetchToMethodCall('Faker\Generator', 'hslColorAsArray', 'hslColorAsArray'), - new PropertyFetchToMethodCall('Faker\Generator', 'company', 'company'), - new PropertyFetchToMethodCall('Faker\Generator', 'companySuffix', 'companySuffix'), - new PropertyFetchToMethodCall('Faker\Generator', 'jobTitle', 'jobTitle'), - new PropertyFetchToMethodCall('Faker\Generator', 'unixTime', 'unixTime'), - new PropertyFetchToMethodCall('Faker\Generator', 'dateTime', 'dateTime'), - new PropertyFetchToMethodCall('Faker\Generator', 'dateTimeAD', 'dateTimeAD'), - new PropertyFetchToMethodCall('Faker\Generator', 'iso8601', 'iso8601'), - new PropertyFetchToMethodCall('Faker\Generator', 'date', 'date'), - new PropertyFetchToMethodCall('Faker\Generator', 'time', 'time'), - new PropertyFetchToMethodCall('Faker\Generator', 'dateTimeBetween', 'dateTimeBetween'), - new PropertyFetchToMethodCall('Faker\Generator', 'dateTimeInInterval', 'dateTimeInInterval'), - new PropertyFetchToMethodCall('Faker\Generator', 'dateTimeThisCentury', 'dateTimeThisCentury'), - new PropertyFetchToMethodCall('Faker\Generator', 'dateTimeThisDecade', 'dateTimeThisDecade'), - new PropertyFetchToMethodCall('Faker\Generator', 'dateTimeThisYear', 'dateTimeThisYear'), - new PropertyFetchToMethodCall('Faker\Generator', 'dateTimeThisMonth', 'dateTimeThisMonth'), - new PropertyFetchToMethodCall('Faker\Generator', 'amPm', 'amPm'), - new PropertyFetchToMethodCall('Faker\Generator', 'dayOfMonth', 'dayOfMonth'), - new PropertyFetchToMethodCall('Faker\Generator', 'dayOfWeek', 'dayOfWeek'), - new PropertyFetchToMethodCall('Faker\Generator', 'month', 'month'), - new PropertyFetchToMethodCall('Faker\Generator', 'monthName', 'monthName'), - new PropertyFetchToMethodCall('Faker\Generator', 'year', 'year'), - new PropertyFetchToMethodCall('Faker\Generator', 'century', 'century'), - new PropertyFetchToMethodCall('Faker\Generator', 'timezone', 'timezone'), - new PropertyFetchToMethodCall('Faker\Generator', 'setDefaultTimezone', 'setDefaultTimezone'), - new PropertyFetchToMethodCall('Faker\Generator', 'getDefaultTimezone', 'getDefaultTimezone'), - new PropertyFetchToMethodCall('Faker\Generator', 'file', 'file'), - new PropertyFetchToMethodCall('Faker\Generator', 'randomHtml', 'randomHtml'), - new PropertyFetchToMethodCall('Faker\Generator', 'imageUrl', 'imageUrl'), - new PropertyFetchToMethodCall('Faker\Generator', 'image', 'image'), - new PropertyFetchToMethodCall('Faker\Generator', 'email', 'email'), - new PropertyFetchToMethodCall('Faker\Generator', 'safeEmail', 'safeEmail'), - new PropertyFetchToMethodCall('Faker\Generator', 'freeEmail', 'freeEmail'), - new PropertyFetchToMethodCall('Faker\Generator', 'companyEmail', 'companyEmail'), - new PropertyFetchToMethodCall('Faker\Generator', 'freeEmailDomain', 'freeEmailDomain'), - new PropertyFetchToMethodCall('Faker\Generator', 'safeEmailDomain', 'safeEmailDomain'), - new PropertyFetchToMethodCall('Faker\Generator', 'userName', 'userName'), - new PropertyFetchToMethodCall('Faker\Generator', 'password', 'password'), - new PropertyFetchToMethodCall('Faker\Generator', 'domainName', 'domainName'), - new PropertyFetchToMethodCall('Faker\Generator', 'domainWord', 'domainWord'), - new PropertyFetchToMethodCall('Faker\Generator', 'tld', 'tld'), - new PropertyFetchToMethodCall('Faker\Generator', 'url', 'url'), - new PropertyFetchToMethodCall('Faker\Generator', 'slug', 'slug'), - new PropertyFetchToMethodCall('Faker\Generator', 'ipv4', 'ipv4'), - new PropertyFetchToMethodCall('Faker\Generator', 'ipv6', 'ipv6'), - new PropertyFetchToMethodCall('Faker\Generator', 'localIpv4', 'localIpv4'), - new PropertyFetchToMethodCall('Faker\Generator', 'macAddress', 'macAddress'), - new PropertyFetchToMethodCall('Faker\Generator', 'word', 'word'), - new PropertyFetchToMethodCall('Faker\Generator', 'words', 'words'), - new PropertyFetchToMethodCall('Faker\Generator', 'sentence', 'sentence'), - new PropertyFetchToMethodCall('Faker\Generator', 'sentences', 'sentences'), - new PropertyFetchToMethodCall('Faker\Generator', 'paragraph', 'paragraph'), - new PropertyFetchToMethodCall('Faker\Generator', 'paragraphs', 'paragraphs'), - new PropertyFetchToMethodCall('Faker\Generator', 'text', 'text'), - new PropertyFetchToMethodCall('Faker\Generator', 'boolean', 'boolean'), - new PropertyFetchToMethodCall('Faker\Generator', 'md5', 'md5'), - new PropertyFetchToMethodCall('Faker\Generator', 'sha1', 'sha1'), - new PropertyFetchToMethodCall('Faker\Generator', 'sha256', 'sha256'), - new PropertyFetchToMethodCall('Faker\Generator', 'locale', 'locale'), - new PropertyFetchToMethodCall('Faker\Generator', 'countryCode', 'countryCode'), - new PropertyFetchToMethodCall('Faker\Generator', 'countryISOAlpha3', 'countryISOAlpha3'), - new PropertyFetchToMethodCall('Faker\Generator', 'languageCode', 'languageCode'), - new PropertyFetchToMethodCall('Faker\Generator', 'currencyCode', 'currencyCode'), - new PropertyFetchToMethodCall('Faker\Generator', 'emoji', 'emoji'), - new PropertyFetchToMethodCall('Faker\Generator', 'creditCardType', 'creditCardType'), - new PropertyFetchToMethodCall('Faker\Generator', 'creditCardNumber', 'creditCardNumber'), - new PropertyFetchToMethodCall('Faker\Generator', 'creditCardExpirationDate', 'creditCardExpirationDate'), - new PropertyFetchToMethodCall( - 'Faker\Generator', - 'creditCardExpirationDateString', - 'creditCardExpirationDateString' - ), - new PropertyFetchToMethodCall('Faker\Generator', 'creditCardDetails', 'creditCardDetails'), - new PropertyFetchToMethodCall('Faker\Generator', 'iban', 'iban'), - new PropertyFetchToMethodCall('Faker\Generator', 'swiftBicNumber', 'swiftBicNumber'), - new PropertyFetchToMethodCall('Faker\Generator', 'name', 'name'), - new PropertyFetchToMethodCall('Faker\Generator', 'firstName', 'firstName'), - new PropertyFetchToMethodCall('Faker\Generator', 'firstNameMale', 'firstNameMale'), - new PropertyFetchToMethodCall('Faker\Generator', 'firstNameFemale', 'firstNameFemale'), - new PropertyFetchToMethodCall('Faker\Generator', 'lastName', 'lastName'), - new PropertyFetchToMethodCall('Faker\Generator', 'title', 'title'), - new PropertyFetchToMethodCall('Faker\Generator', 'titleMale', 'titleMale'), - new PropertyFetchToMethodCall('Faker\Generator', 'titleFemale', 'titleFemale'), - new PropertyFetchToMethodCall('Faker\Generator', 'phoneNumber', 'phoneNumber'), - new PropertyFetchToMethodCall('Faker\Generator', 'e164PhoneNumber', 'e164PhoneNumber'), - new PropertyFetchToMethodCall('Faker\Generator', 'imei', 'imei'), - new PropertyFetchToMethodCall('Faker\Generator', 'realText', 'realText'), - new PropertyFetchToMethodCall('Faker\Generator', 'realTextBetween', 'realTextBetween'), - new PropertyFetchToMethodCall('Faker\Generator', 'macProcessor', 'macProcessor'), - new PropertyFetchToMethodCall('Faker\Generator', 'linuxProcessor', 'linuxProcessor'), - new PropertyFetchToMethodCall('Faker\Generator', 'userAgent', 'userAgent'), - new PropertyFetchToMethodCall('Faker\Generator', 'chrome', 'chrome'), - new PropertyFetchToMethodCall('Faker\Generator', 'firefox', 'firefox'), - new PropertyFetchToMethodCall('Faker\Generator', 'safari', 'safari'), - new PropertyFetchToMethodCall('Faker\Generator', 'opera', 'opera'), - new PropertyFetchToMethodCall('Faker\Generator', 'internetExplorer', 'internetExplorer'), - new PropertyFetchToMethodCall('Faker\Generator', 'windowsPlatformToken', 'windowsPlatformToken'), - new PropertyFetchToMethodCall('Faker\Generator', 'macPlatformToken', 'macPlatformToken'), - new PropertyFetchToMethodCall('Faker\Generator', 'linuxPlatformToken', 'linuxPlatformToken'), - new PropertyFetchToMethodCall('Faker\Generator', 'uuid', 'uuid'), - ]); +return static function (RectorConfig $rectorConfig): void { + $rectorConfig->ruleWithConfiguration(PropertyFetchToMethodCallRector::class, [ + new PropertyFetchToMethodCall('Faker\Generator', 'citySuffix', 'citySuffix'), + new PropertyFetchToMethodCall('Faker\Generator', 'streetSuffix', 'streetSuffix'), + new PropertyFetchToMethodCall('Faker\Generator', 'buildingNumber', 'buildingNumber'), + new PropertyFetchToMethodCall('Faker\Generator', 'city', 'city'), + new PropertyFetchToMethodCall('Faker\Generator', 'streetName', 'streetName'), + new PropertyFetchToMethodCall('Faker\Generator', 'streetAddress', 'streetAddress'), + new PropertyFetchToMethodCall('Faker\Generator', 'postcode', 'postcode'), + new PropertyFetchToMethodCall('Faker\Generator', 'address', 'address'), + new PropertyFetchToMethodCall('Faker\Generator', 'country', 'country'), + new PropertyFetchToMethodCall('Faker\Generator', 'latitude', 'latitude'), + new PropertyFetchToMethodCall('Faker\Generator', 'longitude', 'longitude'), + new PropertyFetchToMethodCall('Faker\Generator', 'localCoordinates', 'localCoordinates'), + new PropertyFetchToMethodCall('Faker\Generator', 'randomDigitNotNull', 'randomDigitNotNull'), + new PropertyFetchToMethodCall('Faker\Generator', 'passthrough', 'passthrough'), + new PropertyFetchToMethodCall('Faker\Generator', 'randomLetter', 'randomLetter'), + new PropertyFetchToMethodCall('Faker\Generator', 'randomAscii', 'randomAscii'), + new PropertyFetchToMethodCall('Faker\Generator', 'randomElements', 'randomElements'), + new PropertyFetchToMethodCall('Faker\Generator', 'randomElement', 'randomElement'), + new PropertyFetchToMethodCall('Faker\Generator', 'randomKey', 'randomKey'), + new PropertyFetchToMethodCall('Faker\Generator', 'shuffle', 'shuffle'), + new PropertyFetchToMethodCall('Faker\Generator', 'shuffleArray', 'shuffleArray'), + new PropertyFetchToMethodCall('Faker\Generator', 'shuffleString', 'shuffleString'), + new PropertyFetchToMethodCall('Faker\Generator', 'numerify', 'numerify'), + new PropertyFetchToMethodCall('Faker\Generator', 'lexify', 'lexify'), + new PropertyFetchToMethodCall('Faker\Generator', 'bothify', 'bothify'), + new PropertyFetchToMethodCall('Faker\Generator', 'asciify', 'asciify'), + new PropertyFetchToMethodCall('Faker\Generator', 'regexify', 'regexify'), + new PropertyFetchToMethodCall('Faker\Generator', 'toLower', 'toLower'), + new PropertyFetchToMethodCall('Faker\Generator', 'toUpper', 'toUpper'), + new PropertyFetchToMethodCall('Faker\Generator', 'optional', 'optional'), + new PropertyFetchToMethodCall('Faker\Generator', 'unique', 'unique'), + new PropertyFetchToMethodCall('Faker\Generator', 'valid', 'valid'), + new PropertyFetchToMethodCall('Faker\Generator', 'biasedNumberBetween', 'biasedNumberBetween'), + new PropertyFetchToMethodCall('Faker\Generator', 'hexColor', 'hexColor'), + new PropertyFetchToMethodCall('Faker\Generator', 'safeHexColor', 'safeHexColor'), + new PropertyFetchToMethodCall('Faker\Generator', 'rgbColorAsArray', 'rgbColorAsArray'), + new PropertyFetchToMethodCall('Faker\Generator', 'rgbColor', 'rgbColor'), + new PropertyFetchToMethodCall('Faker\Generator', 'rgbCssColor', 'rgbCssColor'), + new PropertyFetchToMethodCall('Faker\Generator', 'rgbaCssColor', 'rgbaCssColor'), + new PropertyFetchToMethodCall('Faker\Generator', 'safeColorName', 'safeColorName'), + new PropertyFetchToMethodCall('Faker\Generator', 'colorName', 'colorName'), + new PropertyFetchToMethodCall('Faker\Generator', 'hslColor', 'hslColor'), + new PropertyFetchToMethodCall('Faker\Generator', 'hslColorAsArray', 'hslColorAsArray'), + new PropertyFetchToMethodCall('Faker\Generator', 'company', 'company'), + new PropertyFetchToMethodCall('Faker\Generator', 'companySuffix', 'companySuffix'), + new PropertyFetchToMethodCall('Faker\Generator', 'jobTitle', 'jobTitle'), + new PropertyFetchToMethodCall('Faker\Generator', 'unixTime', 'unixTime'), + new PropertyFetchToMethodCall('Faker\Generator', 'dateTime', 'dateTime'), + new PropertyFetchToMethodCall('Faker\Generator', 'dateTimeAD', 'dateTimeAD'), + new PropertyFetchToMethodCall('Faker\Generator', 'iso8601', 'iso8601'), + new PropertyFetchToMethodCall('Faker\Generator', 'date', 'date'), + new PropertyFetchToMethodCall('Faker\Generator', 'time', 'time'), + new PropertyFetchToMethodCall('Faker\Generator', 'dateTimeBetween', 'dateTimeBetween'), + new PropertyFetchToMethodCall('Faker\Generator', 'dateTimeInInterval', 'dateTimeInInterval'), + new PropertyFetchToMethodCall('Faker\Generator', 'dateTimeThisCentury', 'dateTimeThisCentury'), + new PropertyFetchToMethodCall('Faker\Generator', 'dateTimeThisDecade', 'dateTimeThisDecade'), + new PropertyFetchToMethodCall('Faker\Generator', 'dateTimeThisYear', 'dateTimeThisYear'), + new PropertyFetchToMethodCall('Faker\Generator', 'dateTimeThisMonth', 'dateTimeThisMonth'), + new PropertyFetchToMethodCall('Faker\Generator', 'amPm', 'amPm'), + new PropertyFetchToMethodCall('Faker\Generator', 'dayOfMonth', 'dayOfMonth'), + new PropertyFetchToMethodCall('Faker\Generator', 'dayOfWeek', 'dayOfWeek'), + new PropertyFetchToMethodCall('Faker\Generator', 'month', 'month'), + new PropertyFetchToMethodCall('Faker\Generator', 'monthName', 'monthName'), + new PropertyFetchToMethodCall('Faker\Generator', 'year', 'year'), + new PropertyFetchToMethodCall('Faker\Generator', 'century', 'century'), + new PropertyFetchToMethodCall('Faker\Generator', 'timezone', 'timezone'), + new PropertyFetchToMethodCall('Faker\Generator', 'setDefaultTimezone', 'setDefaultTimezone'), + new PropertyFetchToMethodCall('Faker\Generator', 'getDefaultTimezone', 'getDefaultTimezone'), + new PropertyFetchToMethodCall('Faker\Generator', 'file', 'file'), + new PropertyFetchToMethodCall('Faker\Generator', 'randomHtml', 'randomHtml'), + new PropertyFetchToMethodCall('Faker\Generator', 'imageUrl', 'imageUrl'), + new PropertyFetchToMethodCall('Faker\Generator', 'image', 'image'), + new PropertyFetchToMethodCall('Faker\Generator', 'email', 'email'), + new PropertyFetchToMethodCall('Faker\Generator', 'safeEmail', 'safeEmail'), + new PropertyFetchToMethodCall('Faker\Generator', 'freeEmail', 'freeEmail'), + new PropertyFetchToMethodCall('Faker\Generator', 'companyEmail', 'companyEmail'), + new PropertyFetchToMethodCall('Faker\Generator', 'freeEmailDomain', 'freeEmailDomain'), + new PropertyFetchToMethodCall('Faker\Generator', 'safeEmailDomain', 'safeEmailDomain'), + new PropertyFetchToMethodCall('Faker\Generator', 'userName', 'userName'), + new PropertyFetchToMethodCall('Faker\Generator', 'password', 'password'), + new PropertyFetchToMethodCall('Faker\Generator', 'domainName', 'domainName'), + new PropertyFetchToMethodCall('Faker\Generator', 'domainWord', 'domainWord'), + new PropertyFetchToMethodCall('Faker\Generator', 'tld', 'tld'), + new PropertyFetchToMethodCall('Faker\Generator', 'url', 'url'), + new PropertyFetchToMethodCall('Faker\Generator', 'slug', 'slug'), + new PropertyFetchToMethodCall('Faker\Generator', 'ipv4', 'ipv4'), + new PropertyFetchToMethodCall('Faker\Generator', 'ipv6', 'ipv6'), + new PropertyFetchToMethodCall('Faker\Generator', 'localIpv4', 'localIpv4'), + new PropertyFetchToMethodCall('Faker\Generator', 'macAddress', 'macAddress'), + new PropertyFetchToMethodCall('Faker\Generator', 'word', 'word'), + new PropertyFetchToMethodCall('Faker\Generator', 'words', 'words'), + new PropertyFetchToMethodCall('Faker\Generator', 'sentence', 'sentence'), + new PropertyFetchToMethodCall('Faker\Generator', 'sentences', 'sentences'), + new PropertyFetchToMethodCall('Faker\Generator', 'paragraph', 'paragraph'), + new PropertyFetchToMethodCall('Faker\Generator', 'paragraphs', 'paragraphs'), + new PropertyFetchToMethodCall('Faker\Generator', 'text', 'text'), + new PropertyFetchToMethodCall('Faker\Generator', 'boolean', 'boolean'), + new PropertyFetchToMethodCall('Faker\Generator', 'md5', 'md5'), + new PropertyFetchToMethodCall('Faker\Generator', 'sha1', 'sha1'), + new PropertyFetchToMethodCall('Faker\Generator', 'sha256', 'sha256'), + new PropertyFetchToMethodCall('Faker\Generator', 'locale', 'locale'), + new PropertyFetchToMethodCall('Faker\Generator', 'countryCode', 'countryCode'), + new PropertyFetchToMethodCall('Faker\Generator', 'countryISOAlpha3', 'countryISOAlpha3'), + new PropertyFetchToMethodCall('Faker\Generator', 'languageCode', 'languageCode'), + new PropertyFetchToMethodCall('Faker\Generator', 'currencyCode', 'currencyCode'), + new PropertyFetchToMethodCall('Faker\Generator', 'emoji', 'emoji'), + new PropertyFetchToMethodCall('Faker\Generator', 'creditCardType', 'creditCardType'), + new PropertyFetchToMethodCall('Faker\Generator', 'creditCardNumber', 'creditCardNumber'), + new PropertyFetchToMethodCall('Faker\Generator', 'creditCardExpirationDate', 'creditCardExpirationDate'), + new PropertyFetchToMethodCall( + 'Faker\Generator', + 'creditCardExpirationDateString', + 'creditCardExpirationDateString' + ), + new PropertyFetchToMethodCall('Faker\Generator', 'creditCardDetails', 'creditCardDetails'), + new PropertyFetchToMethodCall('Faker\Generator', 'iban', 'iban'), + new PropertyFetchToMethodCall('Faker\Generator', 'swiftBicNumber', 'swiftBicNumber'), + new PropertyFetchToMethodCall('Faker\Generator', 'name', 'name'), + new PropertyFetchToMethodCall('Faker\Generator', 'firstName', 'firstName'), + new PropertyFetchToMethodCall('Faker\Generator', 'firstNameMale', 'firstNameMale'), + new PropertyFetchToMethodCall('Faker\Generator', 'firstNameFemale', 'firstNameFemale'), + new PropertyFetchToMethodCall('Faker\Generator', 'lastName', 'lastName'), + new PropertyFetchToMethodCall('Faker\Generator', 'title', 'title'), + new PropertyFetchToMethodCall('Faker\Generator', 'titleMale', 'titleMale'), + new PropertyFetchToMethodCall('Faker\Generator', 'titleFemale', 'titleFemale'), + new PropertyFetchToMethodCall('Faker\Generator', 'phoneNumber', 'phoneNumber'), + new PropertyFetchToMethodCall('Faker\Generator', 'e164PhoneNumber', 'e164PhoneNumber'), + new PropertyFetchToMethodCall('Faker\Generator', 'imei', 'imei'), + new PropertyFetchToMethodCall('Faker\Generator', 'realText', 'realText'), + new PropertyFetchToMethodCall('Faker\Generator', 'realTextBetween', 'realTextBetween'), + new PropertyFetchToMethodCall('Faker\Generator', 'macProcessor', 'macProcessor'), + new PropertyFetchToMethodCall('Faker\Generator', 'linuxProcessor', 'linuxProcessor'), + new PropertyFetchToMethodCall('Faker\Generator', 'userAgent', 'userAgent'), + new PropertyFetchToMethodCall('Faker\Generator', 'chrome', 'chrome'), + new PropertyFetchToMethodCall('Faker\Generator', 'firefox', 'firefox'), + new PropertyFetchToMethodCall('Faker\Generator', 'safari', 'safari'), + new PropertyFetchToMethodCall('Faker\Generator', 'opera', 'opera'), + new PropertyFetchToMethodCall('Faker\Generator', 'internetExplorer', 'internetExplorer'), + new PropertyFetchToMethodCall('Faker\Generator', 'windowsPlatformToken', 'windowsPlatformToken'), + new PropertyFetchToMethodCall('Faker\Generator', 'macPlatformToken', 'macPlatformToken'), + new PropertyFetchToMethodCall('Faker\Generator', 'linuxPlatformToken', 'linuxPlatformToken'), + new PropertyFetchToMethodCall('Faker\Generator', 'uuid', 'uuid'), + ]); }; diff --git a/config/set/slevomat-coding-standard.php b/config/set/slevomat-coding-standard.php index 136fcbe..1abb0d2 100644 --- a/config/set/slevomat-coding-standard.php +++ b/config/set/slevomat-coding-standard.php @@ -2,104 +2,105 @@ declare(strict_types=1); -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Symplify\EasyCodingStandard\Config\ECSConfig; -return static function (ContainerConfigurator $containerConfigurator): void { - $services = $containerConfigurator->services(); - $services->set(\SlevomatCodingStandard\Sniffs\Numbers\DisallowNumericLiteralSeparatorSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Operators\NegationOperatorSpacingSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Operators\SpreadOperatorSpacingSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Operators\RequireOnlyStandaloneIncrementAndDecrementOperatorsSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Operators\RequireCombinedAssignmentOperatorSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Classes\ClassMemberSpacingSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Classes\RequireMultiLineMethodSignatureSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Classes\ConstantSpacingSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Classes\TraitUseSpacingSniff::class) - ->property('linesCountAfterLastUse', '1') - ->property('linesCountAfterLastUseWhenLastInClass', '0') - ->property('linesCountBeforeFirstUse', '0'); - $services->set(\SlevomatCodingStandard\Sniffs\Classes\ParentCallSpacingSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Classes\SuperfluousInterfaceNamingSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Classes\SuperfluousTraitNamingSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Classes\SuperfluousAbstractClassNamingSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Classes\DisallowMultiConstantDefinitionSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Classes\ModernClassNameReferenceSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Classes\UselessLateStaticBindingSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Classes\DisallowMultiPropertyDefinitionSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Classes\PropertySpacingSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Classes\ClassConstantVisibilitySniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Classes\MethodSpacingSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Classes\DisallowLateStaticBindingForConstantsSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Classes\TraitUseDeclarationSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Whitespaces\DuplicateSpacesSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\PHP\DisallowDirectMagicInvokeCallSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\PHP\RequireNowdocSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\PHP\TypeCastSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\PHP\ForbiddenClassesSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\PHP\ShortListSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\PHP\ReferenceSpacingSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\PHP\OptimizedFunctionsWithoutUnpackingSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\PHP\UselessParenthesesSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\PHP\UselessSemicolonSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Exceptions\DeadCatchSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Exceptions\DisallowNonCapturingCatchSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Exceptions\RequireNonCapturingCatchSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Exceptions\ReferenceThrowableOnlySniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Namespaces\UselessAliasSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Namespaces\FullyQualifiedClassNameInAnnotationSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Namespaces\UseDoesNotStartWithBackslashSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Namespaces\AlphabeticallySortedUsesSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Namespaces\MultipleUsesPerLineSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Namespaces\UnusedUsesSniff::class) - ->property('searchAnnotations', 'true'); - $services->set(\SlevomatCodingStandard\Sniffs\Namespaces\DisallowGroupUseSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Namespaces\UseSpacingSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Namespaces\NamespaceSpacingSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Namespaces\NamespaceDeclarationSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Namespaces\RequireOneNamespaceInFileSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Namespaces\UseFromSameNamespaceSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Variables\UselessVariableSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Variables\DisallowSuperGlobalVariableSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Variables\UnusedVariableSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Variables\DuplicateAssignmentToVariableSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Arrays\MultiLineArrayEndBracketPlacementSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Arrays\DisallowImplicitArrayCreationSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Arrays\TrailingArrayCommaSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Functions\DisallowNamedArgumentsSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Functions\RequireArrowFunctionSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Functions\UnusedInheritedVariablePassedToClosureSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Functions\UselessParameterDefaultValueSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Functions\ArrowFunctionDeclarationSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\ControlStructures\RequireNullCoalesceOperatorSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\ControlStructures\RequireShortTernaryOperatorSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\ControlStructures\RequireNullCoalesceEqualOperatorSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\ControlStructures\NewWithParenthesesSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\ControlStructures\UselessTernaryOperatorSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\ControlStructures\DisallowContinueWithoutIntegerOperandInSwitchSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\ControlStructures\AssignmentInConditionSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\ControlStructures\RequireNullSafeObjectOperatorSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\ControlStructures\DisallowNullSafeObjectOperatorSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\ControlStructures\LanguageConstructWithParenthesesSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\ControlStructures\UselessIfConditionWithReturnSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\ControlStructures\DisallowYodaComparisonSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\TypeHints\ParameterTypeHintSpacingSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\TypeHints\LongTypeHintsSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\TypeHints\NullTypeHintOnLastPositionSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\TypeHints\PropertyTypeHintSpacingSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\TypeHints\UnionTypeHintFormatSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\TypeHints\PropertyTypeHintSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\TypeHints\DeclareStrictTypesSniff::class) - ->property('newlinesCountBetweenOpenTagAndDeclare', '2') - ->property('spacesCountAroundEqualsSign', '0'); - $services->set(\SlevomatCodingStandard\Sniffs\TypeHints\ReturnTypeHintSpacingSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\TypeHints\NullableTypeForNullDefaultValueSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\TypeHints\ReturnTypeHintSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Commenting\UselessInheritDocCommentSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Commenting\ForbiddenAnnotationsSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Commenting\InlineDocCommentDeclarationSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Commenting\UselessFunctionDocCommentSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Commenting\DisallowCommentAfterCodeSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Commenting\ForbiddenCommentsSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Commenting\EmptyCommentSniff::class); - $services->set(\SlevomatCodingStandard\Sniffs\Commenting\DisallowOneLinePropertyDocCommentSniff::class); +return static function (ECSConfig $containerConfigurator): void { + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Numbers\DisallowNumericLiteralSeparatorSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Operators\NegationOperatorSpacingSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Operators\SpreadOperatorSpacingSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Operators\RequireOnlyStandaloneIncrementAndDecrementOperatorsSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Operators\RequireCombinedAssignmentOperatorSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Classes\ClassMemberSpacingSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Classes\RequireMultiLineMethodSignatureSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Classes\ConstantSpacingSniff::class); + $containerConfigurator->ruleWithConfiguration(\SlevomatCodingStandard\Sniffs\Classes\TraitUseSpacingSniff::class, [ + 'linesCountAfterLastUse' => '1', + 'linesCountAfterLastUseWhenLastInClass' => '0', + 'linesCountBeforeFirstUse' => '0', + ]); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Classes\ParentCallSpacingSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Classes\SuperfluousInterfaceNamingSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Classes\SuperfluousTraitNamingSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Classes\SuperfluousAbstractClassNamingSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Classes\DisallowMultiConstantDefinitionSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Classes\ModernClassNameReferenceSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Classes\UselessLateStaticBindingSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Classes\DisallowMultiPropertyDefinitionSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Classes\PropertySpacingSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Classes\ClassConstantVisibilitySniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Classes\MethodSpacingSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Classes\DisallowLateStaticBindingForConstantsSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Classes\TraitUseDeclarationSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Whitespaces\DuplicateSpacesSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\PHP\DisallowDirectMagicInvokeCallSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\PHP\RequireNowdocSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\PHP\TypeCastSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\PHP\ForbiddenClassesSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\PHP\ShortListSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\PHP\ReferenceSpacingSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\PHP\OptimizedFunctionsWithoutUnpackingSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\PHP\UselessParenthesesSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\PHP\UselessSemicolonSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Exceptions\DeadCatchSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Exceptions\DisallowNonCapturingCatchSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Exceptions\RequireNonCapturingCatchSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Exceptions\ReferenceThrowableOnlySniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Namespaces\UselessAliasSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Namespaces\FullyQualifiedClassNameInAnnotationSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Namespaces\UseDoesNotStartWithBackslashSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Namespaces\AlphabeticallySortedUsesSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Namespaces\MultipleUsesPerLineSniff::class); + $containerConfigurator->ruleWithConfiguration(\SlevomatCodingStandard\Sniffs\Namespaces\UnusedUsesSniff::class, [ + 'searchAnnotations' => 'true', + ]); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Namespaces\DisallowGroupUseSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Namespaces\UseSpacingSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Namespaces\NamespaceSpacingSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Namespaces\NamespaceDeclarationSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Namespaces\RequireOneNamespaceInFileSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Namespaces\UseFromSameNamespaceSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Variables\UselessVariableSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Variables\DisallowSuperGlobalVariableSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Variables\UnusedVariableSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Variables\DuplicateAssignmentToVariableSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Arrays\MultiLineArrayEndBracketPlacementSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Arrays\DisallowImplicitArrayCreationSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Arrays\TrailingArrayCommaSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Functions\DisallowNamedArgumentsSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Functions\RequireArrowFunctionSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Functions\UnusedInheritedVariablePassedToClosureSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Functions\UselessParameterDefaultValueSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Functions\ArrowFunctionDeclarationSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\ControlStructures\RequireNullCoalesceOperatorSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\ControlStructures\RequireShortTernaryOperatorSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\ControlStructures\RequireNullCoalesceEqualOperatorSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\ControlStructures\NewWithParenthesesSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\ControlStructures\UselessTernaryOperatorSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\ControlStructures\DisallowContinueWithoutIntegerOperandInSwitchSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\ControlStructures\AssignmentInConditionSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\ControlStructures\RequireNullSafeObjectOperatorSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\ControlStructures\DisallowNullSafeObjectOperatorSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\ControlStructures\LanguageConstructWithParenthesesSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\ControlStructures\UselessIfConditionWithReturnSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\ControlStructures\DisallowYodaComparisonSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\TypeHints\ParameterTypeHintSpacingSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\TypeHints\LongTypeHintsSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\TypeHints\NullTypeHintOnLastPositionSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\TypeHints\PropertyTypeHintSpacingSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\TypeHints\UnionTypeHintFormatSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\TypeHints\PropertyTypeHintSniff::class); + $containerConfigurator->ruleWithConfiguration(\SlevomatCodingStandard\Sniffs\TypeHints\DeclareStrictTypesSniff::class, [ + 'spacesCountAroundEqualsSign' => '0', + ]); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\TypeHints\ReturnTypeHintSpacingSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\TypeHints\NullableTypeForNullDefaultValueSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\TypeHints\ReturnTypeHintSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Commenting\UselessInheritDocCommentSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Commenting\ForbiddenAnnotationsSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Commenting\InlineDocCommentDeclarationSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Commenting\UselessFunctionDocCommentSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Commenting\DisallowCommentAfterCodeSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Commenting\ForbiddenCommentsSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Commenting\EmptyCommentSniff::class); + $containerConfigurator->rule(\SlevomatCodingStandard\Sniffs\Commenting\DisallowOneLinePropertyDocCommentSniff::class); }; diff --git a/ecs.php b/ecs.php index 1ea2fd9..0674859 100644 --- a/ecs.php +++ b/ecs.php @@ -3,30 +3,25 @@ declare(strict_types=1); use PHP_CodeSniffer\Standards\PSR1\Sniffs\Methods\CamelCapsMethodNameSniff; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -use Symplify\EasyCodingStandard\ValueObject\Option; +use Symplify\CodingStandard\Fixer\LineLength\LineLengthFixer; +use Symplify\EasyCodingStandard\Config\ECSConfig; use Zing\CodingStandard\Set\ECSSetList; -return static function (ContainerConfigurator $containerConfigurator): void { - $containerConfigurator->import(ECSSetList::PHP_72); - $containerConfigurator->import(ECSSetList::CUSTOM); - - $parameters = $containerConfigurator->parameters(); - $parameters->set(Option::PARALLEL, true); - $parameters->set(Option::SKIP, [ +return static function (ECSConfig $ecsConfig): void { + $ecsConfig->sets([ECSSetList::PHP_72, ECSSetList::CUSTOM]); + $ecsConfig->parallel(); + $ecsConfig->skip([ CamelCapsMethodNameSniff::class => [__DIR__ . '/src/Printer.php'], - \Symplify\CodingStandard\Fixer\LineLength\LineLengthFixer::class => [__DIR__ . '/config'], + LineLengthFixer::class => [__DIR__ . '/config'], + ]); + + $ecsConfig->paths([ + __DIR__ . '/bin', + __DIR__ . '/config', + __DIR__ . '/fixed', + __DIR__ . '/src', + __DIR__ . '/tests', + __DIR__ . '/ecs.php', + __DIR__ . '/rector.php', ]); - $parameters->set( - Option::PATHS, - [ - __DIR__ . '/bin', - __DIR__ . '/config', - __DIR__ . '/fixed', - __DIR__ . '/src', - __DIR__ . '/tests', - __DIR__ . '/ecs.php', - __DIR__ . '/rector.php', - ] - ); }; diff --git a/rector.php b/rector.php index d477d05..e45ee37 100644 --- a/rector.php +++ b/rector.php @@ -2,47 +2,34 @@ declare(strict_types=1); -use Rector\Core\Configuration\Option; +use Rector\Config\RectorConfig; use Rector\Naming\Rector\Assign\RenameVariableToMatchMethodCallReturnTypeRector; use Rector\Naming\Rector\ClassMethod\RenameParamToMatchTypeRector; use Rector\PHPUnit\Set\PHPUnitSetList; use Rector\Privatization\Rector\MethodCall\PrivatizeLocalGetterToPropertyRector; use Rector\Set\ValueObject\LevelSetList; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; use Zing\CodingStandard\Set\RectorSetList; -return static function (ContainerConfigurator $containerConfigurator): void { - $containerConfigurator->import(LevelSetList::UP_TO_PHP_72); - $containerConfigurator->import(RectorSetList::CUSTOM); - $containerConfigurator->import(PHPUnitSetList::PHPUNIT_CODE_QUALITY); +return static function (RectorConfig $rectorConfig): void { + $rectorConfig->sets([LevelSetList::UP_TO_PHP_72, RectorSetList::CUSTOM, PHPUnitSetList::PHPUNIT_CODE_QUALITY]); + $rectorConfig->parallel(); + $rectorConfig->bootstrapFiles([ + __DIR__ . '/vendor/squizlabs/php_codesniffer/autoload.php', + __DIR__ . '/vendor/symplify/easy-coding-standard/vendor/autoload.php', + ]); + $rectorConfig->skip([ + RenameParamToMatchTypeRector::class, + RenameVariableToMatchMethodCallReturnTypeRector::class, + PrivatizeLocalGetterToPropertyRector::class, + ]); - $parameters = $containerConfigurator->parameters(); - $parameters->set(Option::PARALLEL, true); - $parameters->set( - Option::BOOTSTRAP_FILES, - [ - __DIR__ . '/vendor/squizlabs/php_codesniffer/autoload.php', - __DIR__ . '/vendor/symplify/easy-coding-standard/vendor/autoload.php', - ] - ); - $parameters->set( - Option::SKIP, - [ - RenameParamToMatchTypeRector::class, - RenameVariableToMatchMethodCallReturnTypeRector::class, - PrivatizeLocalGetterToPropertyRector::class, - ] - ); - $parameters->set( - Option::PATHS, - [ - __DIR__ . '/bin', - __DIR__ . '/config', - __DIR__ . '/fixed', - __DIR__ . '/src', - __DIR__ . '/tests', - __DIR__ . '/ecs.php', - __DIR__ . '/rector.php', - ] - ); + $rectorConfig->paths([ + __DIR__ . '/bin', + __DIR__ . '/config', + __DIR__ . '/fixed', + __DIR__ . '/src', + __DIR__ . '/tests', + __DIR__ . '/ecs.php', + __DIR__ . '/rector.php', + ]); }; diff --git a/src/Printers/PHPCodeSnifferRuleSetPrinter.php b/src/Printers/PHPCodeSnifferRuleSetPrinter.php deleted file mode 100644 index b01dfea..0000000 --- a/src/Printers/PHPCodeSnifferRuleSetPrinter.php +++ /dev/null @@ -1,19 +0,0 @@ - $value) { - $expr = $this->builderFactory->methodCall($expr, 'property', [$key, $value]); - } - - return $expr; - } -} diff --git a/src/Printers/PhpCsFixerRuleSetPrinter.php b/src/Printers/PhpCsFixerRuleSetPrinter.php deleted file mode 100644 index 30337e0..0000000 --- a/src/Printers/PhpCsFixerRuleSetPrinter.php +++ /dev/null @@ -1,19 +0,0 @@ -builderFactory->methodCall($expr, 'call', ['configure', [$configuration]]); - } - - return $expr; - } -} diff --git a/src/Printers/RuleSetPrinter.php b/src/Printers/RuleSetPrinter.php index 2832f66..cd3c5fe 100644 --- a/src/Printers/RuleSetPrinter.php +++ b/src/Printers/RuleSetPrinter.php @@ -5,10 +5,7 @@ namespace Zing\CodingStandard\Printers; use PhpParser\BuilderFactory; -use PhpParser\Node\Expr; -use PhpParser\Node\Expr\Assign; use PhpParser\Node\Expr\Closure; -use PhpParser\Node\Expr\Variable; use PhpParser\Node\Name; use PhpParser\Node\Name\FullyQualified; use PhpParser\Node\Scalar\LNumber; @@ -19,20 +16,20 @@ use PhpParser\Node\Stmt\Return_; use PhpParser\Node\Stmt\Use_; use PhpParser\Node\Stmt\UseUse; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Symplify\EasyCodingStandard\Config\ECSConfig; use Zing\CodingStandard\Printer; -abstract class RuleSetPrinter +final class RuleSetPrinter { /** * @var \PhpParser\BuilderFactory */ - protected $builderFactory; + private $builderFactory; /** * @var \Zing\CodingStandard\Printer */ - protected $printer; + private $printer; public function __construct(BuilderFactory $builderFactory, Printer $printer) { @@ -43,24 +40,29 @@ public function __construct(BuilderFactory $builderFactory, Printer $printer) public function print(array $services): string { $param = $this->builderFactory->param('containerConfigurator') - ->setType('ContainerConfigurator') + ->setType('ECSConfig') ->getNode(); $stmts = []; - $variable = new Variable('services'); - - $stmts[] = new Expression(new Assign($variable, $this->builderFactory->methodCall($param->var, 'services'))); foreach ($services as $service => $configuration) { $classConstFetch = $this->builderFactory->classConstFetch(new FullyQualified($service), 'class'); - $expr = $this->builderFactory->methodCall($variable, 'set', [$classConstFetch]); + if ($configuration !== []) { + $expr = $this->builderFactory->methodCall( + $param->var, + 'ruleWithConfiguration', + [$classConstFetch, $configuration] + ); + } else { + $expr = $this->builderFactory->methodCall($param->var, 'rule', [$classConstFetch]); + } - $stmts[] = new Expression($this->configureService($expr, $configuration)); + $stmts[] = new Expression($expr); } return $this->printer ->prettyPrintFile([ new Declare_([new DeclareDeclare('strict_types', new LNumber(1))]), new Nop(), - new Use_([new UseUse(new Name(ContainerConfigurator::class))]), + new Use_([new UseUse(new Name(ECSConfig::class))]), new Nop(), new Return_(new Closure([ 'static' => true, @@ -71,6 +73,4 @@ public function print(array $services): string new Nop(), ]); } - - abstract public function configureService(Expr $expr, array $configuration): Expr; } diff --git a/src/Standards/SlevomatCodingStandardCustom/ruleset.xml b/src/Standards/SlevomatCodingStandardCustom/ruleset.xml index b682661..89220de 100644 --- a/src/Standards/SlevomatCodingStandardCustom/ruleset.xml +++ b/src/Standards/SlevomatCodingStandardCustom/ruleset.xml @@ -77,7 +77,6 @@ -