Skip to content

Rules that are not registered in the config are executed #9873

Description

@CybotTM

Bug Report

Subject Details
Rector version rector-src 820c9dad

tests/Issues/Issue9388 in this repository registers two rules. Three run.

Minimal PHP Code Causing Issue

Boot tests/Issues/Issue9388/config/configured_rule.php and ask the container:

findByContract(RectorInterface::class):  RenameClassRector, ExtbaseAnnotationToAttributeRector, StringClassNameToClassConstantRector
getMainRectorClasses():                  RenameClassRector, ExtbaseAnnotationToAttributeRector

StringClassNameToClassConstantRector is never registered by that config. It runs against every fixture of the test.

Expected Behaviour

Only registered rules run.

Filing this as an issue rather than a PR — rectorphp/rector-src#8402 was closed — so someone else can pick up a patch.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions