Skip to content

Undefined method Rector\Config\RectorConfig::tag() when upgrading from 2.6.3 to 2.6.4 #9880

Description

@u01jmg3

Bug Report

Subject Details
Rector version 2.6.4

Minimal PHP Code Causing Issue

The project does not explicitly call RectorConfig::tag().

The error occurs when upgrading rector/rector from 2.6.3 to 2.6.4:

Call to undefined method Rector\Config\RectorConfig::tag()

The same configuration works correctly with Rector 2.6.3.

Expected Behaviour

Rector 2.6.4 should process the existing configuration without attempting to call the undefined RectorConfig::tag() method.

The project does not directly use RectorConfig::tag(), so the call appears to originate from Rector itself or from one of the configured rules/sets.

Rector Config
<?php

declare(strict_types=1);

use Rector\Config\RectorConfig;
use Rector\Set\ValueObject\SetList;
use Rector\ValueObject\PhpVersion;
use RectorLaravel\Set\LaravelSetList;

return RectorConfig::configure()
    ->withParallel(120 * 2, 16, 16)
    ->withPhpVersion(PhpVersion::PHP_74)
    ->withSets([
        LaravelSetList::LARAVEL_50,
        LaravelSetList::LARAVEL_51,
        LaravelSetList::LARAVEL_52,
        LaravelSetList::LARAVEL_53,
        LaravelSetList::LARAVEL_54,
        SetList::CODE_QUALITY,
        SetList::CODING_STYLE,
        SetList::DEAD_CODE,
        SetList::PHP_70,
        SetList::PHP_71,
        SetList::PHP_72,
        SetList::PHP_73,
        SetList::PHP_74,
    ])
    ->withPaths([
        __DIR__ . DIRECTORY_SEPARATOR . 'app' . DIRECTORY_SEPARATOR . 'Console',
        __DIR__ . DIRECTORY_SEPARATOR . 'app' . DIRECTORY_SEPARATOR . 'Models',
        __DIR__ . DIRECTORY_SEPARATOR . 'app' . DIRECTORY_SEPARATOR . 'Providers',
        __DIR__ . DIRECTORY_SEPARATOR . 'config',
        __DIR__ . DIRECTORY_SEPARATOR . 'tests',
    ])
    ->withSkip([
        // Files
        __DIR__ . DIRECTORY_SEPARATOR . 'app/Console/Kernel.php',
        // Rectors
        Rector\CodeQuality\Rector\Class_\CompleteDynamicPropertiesRector::class,
        Rector\CodeQuality\Rector\FuncCall\ChangeArrayPushToArrayAssignRector::class,
        Rector\CodeQuality\Rector\FuncCall\CompactToVariablesRector::class,
        Rector\CodeQuality\Rector\Identical\BooleanNotIdenticalToNotIdenticalRector::class,
        Rector\CodeQuality\Rector\Identical\SimplifyBoolIdenticalTrueRector::class,
        Rector\CodeQuality\Rector\If_\SimplifyIfReturnBoolRector::class,
        Rector\CodeQuality\Rector\Isset_\IssetOnPropertyObjectToPropertyExistsRector::class,
        Rector\CodeQuality\Rector\FunctionLike\SimplifyUselessVariableRector::class,
        Rector\DeadCode\Rector\Assign\RemoveUnusedVariableAssignRector::class,
        Rector\Php70\Rector\MethodCall\ThisCallOnStaticMethodToStaticCallRector::class,
        Rector\Php71\Rector\TryCatch\MultiExceptionCatchRector::class,
        Rector\Php74\Rector\Closure\ClosureToArrowFunctionRector::class,
        Rector\DeadCode\Rector\ClassMethod\RemoveUselessParamTagRector::class,
        Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPromotedPropertyRector::class,
        Rector\CodingStyle\Rector\Stmt\NewlineAfterStatementRector::class,
        Rector\DeadCode\Rector\StaticCall\RemoveParentCallWithoutParentRector::class,
        Rector\Transform\Rector\String_\StringToClassConstantRector::class,
        Rector\CodeQuality\Rector\FuncCall\InlineIsAInstanceOfRector::class,
        Rector\DeadCode\Rector\ClassMethod\RemoveUselessReturnTagRector::class,
        Rector\CodingStyle\Rector\ClassLike\NewlineBetweenClassLikeStmtsRector::class,
        Rector\TypeDeclaration\Rector\StmtsAwareInterface\SafeDeclareStrictTypesRector::class,
    ]);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions