PHPCSStandards / PHPCSUtils

A suite of utility functions for use with PHP_CodeSniffer
https://phpcsutils.com/
GNU Lesser General Public License v3.0
54 stars 7 forks source link

Add method to get a token at the same level as the start token #498

Open jrfnl opened 1 year ago

jrfnl commented 1 year ago

Sort of a mix between the File::getNext()/File::getPrevious() methods and the File::getStartOfStatement()/File::getEndOfStatement() methods.

Method should take the following parameters: File $phpcsFile, int $stackPtr, ?int $end, array|string|int $types

The method should skip over:

$types should be checked to not include the tokens being skipped over.

Typical use cases: