Skip to content

Complete the Rector rename-skip family and audit the existing skip list #2981

Description

@AlexSkrypnyk

Summary

rector.php already skips RenameVariableToMatchMethodCallReturnTypeRector, RenameVariableToMatchNewTypeRector and RenameParamToMatchTypeRector - the established position being that Rector should not rename developers' variables. The Foreach_ members of the same family were never added, so they still fire.

Three downstream Vortex sites independently added the same skip, which points at an incomplete list rather than three separate preferences.

Details

Add to the skip list:

  • Rector\Naming\Rector\Foreach_\RenameForeachValueVariableToMatchMethodCallReturnTypeRector - added independently by three downstream sites.
  • Rector\Naming\Rector\Foreach_\RenameForeachValueVariableToMatchExprVariableRector - added by one; same family, same rationale.

While in the file, audit the whole skip list:

  • Check each existing skip still reproduces against the current Rector and Drupal Rector versions. Skips accumulate around rules that later change behaviour, get renamed, or are removed upstream, and a stale entry silently suppresses a rule that would now be useful - or names a class that no longer exists.
  • Remove any override that no longer has a reason.
  • Add a short comment to each skip that stays, so the next audit does not have to rediscover why it is there. Several current entries have none.
  • Confirm the withPhpSets() level still matches the PHP version the template targets.

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

    A2Working clone index A2

    Type

    No type

    Projects

    • Status
      Released in 1.41.0

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions