Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jrfnl opened this issue Aug 21, 2023 · 0 comments

Comments

@jrfnl
Copy link
Member

jrfnl commented Aug 21, 2023

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant