import(SetList::COMMON); $ecsConfig->import(SetList::CLEAN_CODE); $ecsConfig->dynamicSets(['@Symfony']); $ecsConfig->import(SetList::PSR_12); $ecsConfig->dynamicSets(['@PhpCsFixer']); $ecsConfig->import(SetList::DOCTRINE_ANNOTATIONS); $ecsConfig->dynamicSets(['@Symfony:risky']); $ecsConfig->rule(DisallowLongArraySyntaxSniff::class); $ecsConfig->rule(TrailingCommaInMultilineFixer::class); $ecsConfig->rule(PhpdocNoPackageFixer::class); $ecsConfig->rule(UselessFunctionDocCommentSniff::class); $ecsConfig->rule(PropertyTypeHintSniff::class); $ecsConfig->ruleWithConfiguration( YodaStyleFixer::class, ['equal' => true, 'identical' => true, 'less_and_greater' => false] ); $ecsConfig->rule(NoSuperfluousPhpdocTagsFixer::class); $ecsConfig->rule(VoidReturnFixer::class); $ecsConfig->rule(DeclareStrictTypesFixer::class); $ecsConfig->rule(NoEmptyPhpdocFixer::class); $ecsConfig->rule(NoUselessElseFixer::class); $ecsConfig->rule(NoUselessReturnFixer::class); $ecsConfig->rule(ModernizeTypesCastingFixer::class); $ecsConfig->rule(ConstantCaseFixer::class); $ecsConfig->rule(OrderedClassElementsFixer::class); $ecsConfig->ruleWithConfiguration( ConcatSpaceFixer::class, [ 'spacing' => 'none', ] ); $ecsConfig->ruleWithConfiguration( GlobalNamespaceImportFixer::class, [ 'import_classes' => true, 'import_constants' => true, 'import_functions' => false, ] ); $ecsConfig->paths([ __DIR__.'/src', __DIR__.'/tests/CoreBundle', __DIR__.'/tests/CourseBundle', //__DIR__.'/public/main/admin', ]); $ecsConfig->skip([ __DIR__.'/src/CoreBundle/Hook/*', __DIR__.'/src/CoreBundle/Component/HTMLPurifier/Filter/AllowIframes.php', __DIR__.'/src/CoreBundle/Traits/Repository/*', __DIR__.'/src/CourseBundle/Component/*', __DIR__.'/src/DataFixtures/*', __DIR__.'/src/CoreBundle/Entity/ResourceInterface.php', IncrementStyleFixer::class => 'post', PropertyTypeHintSniff::class.'.'.PropertyTypeHintSniff::CODE_MISSING_TRAVERSABLE_TYPE_HINT_SPECIFICATION, PropertyTypeHintSniff::class.'.'.PropertyTypeHintSniff::CODE_MISSING_NATIVE_TYPE_HINT, PhpCsFixer\Fixer\PhpUnit\PhpUnitInternalClassFixer::class, DoctrineAnnotationArrayAssignmentFixer::class, SingleLineCommentStyleFixer::class, NotOperatorWithSuccessorSpaceFixer::class, //\PhpCsFixer\Fixer\Phpdoc\PhpdocOrderFixer::class, PhpCsFixer\Fixer\Phpdoc\PhpdocTypesOrderFixer::class, PhpCsFixer\Fixer\DoctrineAnnotation\DoctrineAnnotationSpacesFixer::class, PhpCsFixer\Fixer\StringNotation\ExplicitStringVariableFixer::class, ClassAttributesSeparationFixer::class, FopenFlagsFixer::class, ArrayOpenerAndCloserNewlineFixer::class, ArrayListItemNewlineFixer::class, StandaloneLineInMultilineArrayFixer::class, //UnusedVariableSniff::class . '.ignoreUnusedValuesWhenOnlyKeysAreUsedInForeach' => true, //UnusedVariableSniff::class => 'ignoreUnusedValuesWhenOnlyKeysAreUsedInForeach', AssignmentInConditionSniff::class.'.FoundInWhileCondition', AssignmentInConditionSniff::class.'.Found', PhpUnitTestClassRequiresCoversFixer::class, ]); };