{"record":{"id":"1457aaffb06362a2","repo":"rectorphp/rector","slug":"these-rules-from-rectorconfig-skip-do-not-ex","errorCode":null,"errorMessage":"These rules from \"$rectorConfig->skip()\" do not exist - remove them or fix their names:","messagePattern":"These rules from \"\\$rectorConfig->skip\\(\\)\" do not exist - remove them or fix their names:","errorType":"validation","errorClass":"ShouldNotHappenException","httpStatus":null,"severity":"error","filePath":"src/Validation/RectorConfigValidator.php","lineNumber":63,"sourceCode":"            if (!self::isRectorClassValue($value)) {\n                continue;\n            }\n            if (class_exists($value)) {\n                $skippedRectorRules[] = $value;\n                continue;\n            }\n            $nonExistingRules[] = $value;\n        }\n        SimpleParameterProvider::addParameter(Option::SKIPPED_RECTOR_RULES, $skippedRectorRules);\n        SimpleParameterProvider::addParameter(Option::SKIPPED_NON_RECTOR_CLASSES, $skippedNonRectorClasses);\n        if ($nonExistingRules === []) {\n            return;\n        }\n        $nonExistingRulesString = '';\n        foreach ($nonExistingRules as $nonExistingRule) {\n            $nonExistingRulesString .= ' * ' . $nonExistingRule . \\PHP_EOL;\n        }\n        throw new ShouldNotHappenException('These rules from \"$rectorConfig->skip()\" do not exist - remove them or fix their names:' . \\PHP_EOL . $nonExistingRulesString);\n    }\n    /**\n     * Only Rector rules are matched against skipped classes, so any other class can never be skipped\n     */\n    private static function isNonRectorClass(string $key): bool\n    {\n        // interfaces are allowed, as they can mark a group of Rector rules\n        if (!class_exists($key)) {\n            return \\false;\n        }\n        if (is_a($key, RectorInterface::class, \\true)) {\n            return \\false;\n        }\n        return !is_a($key, PostRectorInterface::class, \\true);\n    }\n    /**\n     * @param mixed $value\n     */","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/rectorphp/rector/blob/408fcb0ff1833e3d26cbc9b04c23a77565814a16/src/Validation/RectorConfigValidator.php#L45-L81","documentation":"Rector validates every entry passed to RectorConfig::skip() (src/Config/RectorConfig.php:126) and throws a ShouldNotHappenException listing all skip entries that are not existing classes. The skip list is matched against real Rector rules, paths and class names, so a typo'd or renamed rule name can never match anything and would silently disable the skip - Rector refuses to run instead of ignoring your intent. This check runs when the rector.php config is loaded, before analysis starts.","triggerScenarios":"Calling $rectorConfig->skip([...]) with a misspelled class name (e.g. 'TypeDeclarationRector' instead of the real FQCN); skipping a rule class that was renamed or removed in a newer rector/rector or vendor package version; skipping by constant from an old SetList (e.g. SetList::DEAD_CODE string value) instead of a rule class name; entries left over after the rule they excluded was deleted from the codebase.","commonSituations":"Upgrading rector/rector (or a ruleset package) to a major version where rule classes were renamed, and old skip entries no longer resolve; copy-pasting skip lines from blog posts or another project's rector.php that reference rules your installed version does not contain; CI suddenly failing after composer update although nothing in the repo changed, because the vendor rule class disappeared; refactoring where the excluded rule was deleted and the skip entry was forgotten.","solutions":["Read the exception message: it lists every non-existing entry with ' * ' prefix; remove those entries from skip() or correct their spelling to the real FQCN.","If the rule was renamed in a newer version, find the new class name (vendor/rector/rector-src, your IDE, or the vendor package changelog) and update the skip entry to the new class-string.","Verify each remaining entry resolves: run a quick check like `php -r \"var_dump(class_exists($argv[1], true) || interface_exists($argv[1], true));\" SomeRectorClass` for each skip entry.","Pin or align versions: if the skip entries come from a ruleset package, make sure your rector/rector version matches the one that package expects, so the skipped class names exist again."],"exampleFix":"// before\n$rectorConfig->skip([\n    Rectify\\TypeDeclaration\\Rector\\Property\\TypedPropertyRector::class, // typo + wrong namespace\n    Rector\\CodeQuality\\Rector\\If_\\CombinedIfRector::class,\n]);\n\n// after\n$rectorConfig->skip([\n    Rector\\CodeQuality\\Rector\\If_\\CombinedIfRector::class,\n]);","handlingStrategy":"validation","validationCode":"// before calling $rectorConfig->skip() in rector.php\n$skip = [\n    Rector\\CodeQuality\\Rector\\If_\\CombinedIfRector::class,\n    'Rector\\TypeDeclaration\\Rector\\Property\\MaybeTypedRector', // typo, would throw\n];\n$nonExisting = array_filter($skip, function ($entry): bool {\n    if (!is_string($entry)) {\n        return false; // path or fn-style entries, not class names\n    }\n    return !class_exists($entry) && !interface_exists($entry);\n});\nif ($nonExisting !== []) {\n    throw new InvalidArgumentException('Skip entries do not exist: ' . implode(', ', $nonExisting));\n}\n$rectorConfig->skip($skip);","typeGuard":"function skipEntriesExist(array $skip): bool\n{\n    foreach ($skip as $entry) {\n        if (is_string($entry) && !class_exists($entry) && !interface_exists($entry)) {\n            return false;\n        }\n    }\n    return true;\n}","tryCatchPattern":null,"preventionTips":["Always use ::class constants instead of quoted strings for rule names in skip(), so renames surface as PHP fatal errors in the owning file instead of Rector validation errors.","After every `composer update` of rector/rector or a ruleset package, run `vendor/bin/rector process --dry-run` on a tiny path to catch stale skip entries early in CI.","Delete skip entries in the same commit that removes/renames the rule they reference."],"tags":["rector","skip","typo","class-not-found","config","php"],"backgroundTag":"unknown-class-in-config","analyzedSha":"408fcb0ff1833e3d26cbc9b04c23a77565814a16","analyzedAt":"2026-08-21T05:11:02.643Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}