Lines Matching refs:stackPtr

58      * @param int                  $stackPtr  The position of the current token
63 public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) argument
67 if (isset($tokens[$stackPtr]['parenthesis_opener']) === false
68 || isset($tokens[$stackPtr]['parenthesis_closer']) === false
69 || $tokens[$stackPtr]['parenthesis_opener'] === null
70 || $tokens[$stackPtr]['parenthesis_closer'] === null
75 $openBracket = $tokens[$stackPtr]['parenthesis_opener'];
76 $closeBracket = $tokens[$stackPtr]['parenthesis_closer'];
79 if ($tokens[($stackPtr + 1)]['content'] === $phpcsFile->eolChar) {
81 } else if ($tokens[($stackPtr + 1)]['code'] === T_WHITESPACE) {
82 $spaces = strlen($tokens[($stackPtr + 1)]['content']);
90 $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceAfterFunction', $data);
93 $phpcsFile->fixer->addContent($stackPtr, ' ');
95 $phpcsFile->fixer->replaceToken(($stackPtr + 1), ' ');
103 if ($tokens[$stackPtr]['code'] === T_FUNCTION) {
123 if ($tokens[$stackPtr]['code'] === T_CLOSURE) {
124 … $use = $phpcsFile->findNext(T_USE, ($closeBracket + 1), $tokens[$stackPtr]['scope_opener']);
170 if ($this->isMultiLineDeclaration($phpcsFile, $stackPtr, $openBracket, $tokens) === true) {
171 $this->processMultiLineDeclaration($phpcsFile, $stackPtr, $tokens);
173 $this->processSingleLineDeclaration($phpcsFile, $stackPtr, $tokens);
183 * @param int $stackPtr The position of the current token
192 …public function isMultiLineDeclaration(PHP_CodeSniffer_File $phpcsFile, $stackPtr, $openBracket, $… argument
200 if ($tokens[$stackPtr]['code'] === T_CLOSURE) {
201 … $use = $phpcsFile->findNext(T_USE, ($closeBracket + 1), $tokens[$stackPtr]['scope_opener']);
224 * @param int $stackPtr The position of the current token
231 … public function processSingleLineDeclaration(PHP_CodeSniffer_File $phpcsFile, $stackPtr, $tokens) argument
233 if ($tokens[$stackPtr]['code'] === T_CLOSURE) {
248 $sniff->process($phpcsFile, $stackPtr);
257 * @param int $stackPtr The position of the current token
264 public function processMultiLineDeclaration(PHP_CodeSniffer_File $phpcsFile, $stackPtr, $tokens) argument
270 for ($i = ($stackPtr - 1); $i >= 0; $i--) {
271 if ($tokens[$i]['line'] !== $tokens[$stackPtr]['line']) {
283 $closeBracket = $tokens[$stackPtr]['parenthesis_closer'];
304 if ($tokens[$stackPtr]['code'] === T_CLOSURE) {
305 … $use = $phpcsFile->findNext(T_USE, ($closeBracket + 1), $tokens[$stackPtr]['scope_opener']);
330 $openBracket = $tokens[$stackPtr]['parenthesis_opener'];
334 if ($i === $tokens[$stackPtr]['parenthesis_closer']
337 || ($i + 1) === $tokens[$stackPtr]['parenthesis_closer']))
396 if (isset($tokens[$stackPtr]['scope_opener']) === false) {
401 $opener = $tokens[$stackPtr]['scope_opener'];