Skip to content

Add method to get a token within the same scope as the $stackPtr (before/after) #499

Open
@jrfnl

Description

@jrfnl

Sort of a scoped version of the File::getNext()/File::getPrevious() methods.

Method should take the following parameters: File $phpcsFile, int $stackPtr, $skipFn = true

The method should automatically limit searches to its own scope, i.e. the function/method it is in or the global scope.

The method should skip over:

  • All nested closed construct declarations (function/closure/class etc)
  • Optionally skip over (open scope) arrow function declarations.

Typical use cases:

  • Finding an assignment to a variable within the current scope.
  • Finding the use of a function within the current scope.
  • etc

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions