Skip to content

Scope not available on "PhpParser\Node\ArrayItem" node #9628

Closed

Description

@eliashaeussler

Bug Report

Subject Details
PHP version 8.2.30
Rector version 2.3.5

Running the code below results in a Scope not available on "PhpParser\Node\ArrayItem" node error. This is confusing, because the rule should actually not be relevant for the given code, since it should only apply to classes implementing PHPUnit's TestCase, from my understanding.

Minimal PHP Code Causing Issue

https://getrector.com/demo/da6425e5-7a8e-44ff-ac74-b1c0b478695e

Expected Behaviour

No error should be reported, the file should remain unchanged.

Activity

  1. samsonasik commented on Feb 3, 2026

    @samsonasik
    Member

    Resolved on rector-src rectorphp/rector-src#7873
    Failing fixture proof on rector-phpunit rectorphp/rector-phpunit#632

  2. github-actions commented on Sep 6, 2026

    @github-actions
    Contributor

    This issue has been automatically locked because it has been closed for 150 days. Please open a new issue if you have a similar problem.

  3. locked as resolved and limited conversation to collaborators on Sep 6, 2026
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