Lines Matching refs:stackPtr

63      * @param int                  $stackPtr  The position of the current token in the
68 public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) argument
75 if ($tokens[$stackPtr]['code'] === T_DOC_COMMENT_OPEN_TAG) {
78 ($stackPtr + 1),
126 ($stackPtr - 1),
135 if ($tokens[$stackPtr]['content'] === '/**') {
137 $phpcsFile->addError($error, $stackPtr, 'DocBlock');
141 if ($tokens[$stackPtr]['content']{0} === '#') {
143 $fix = $phpcsFile->addFixableError($error, $stackPtr, 'WrongStyle');
145 $comment = ltrim($tokens[$stackPtr]['content'], "# \t");
146 $phpcsFile->fixer->replaceToken($stackPtr, "// $comment");
152 $previousContent = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true);
153 if ($tokens[$previousContent]['line'] === $tokens[$stackPtr]['line']) {
169 $comment = rtrim($tokens[$stackPtr]['content']);
201 $fix = $phpcsFile->addFixableError($error, $stackPtr, 'TabBefore', $data);
208 $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoSpaceBefore', $data);
216 $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingBefore', $data);
220 $newComment = '// '.ltrim($tokens[$stackPtr]['content'], "/\t ");
221 $phpcsFile->fixer->replaceToken($stackPtr, $newComment);
228 $nextComment = $phpcsFile->findNext(array(T_COMMENT), ($stackPtr + 1), null, false);
230 && (($tokens[$nextComment]['line']) === ($tokens[$stackPtr]['line'] + 1))
235 $topComment = $stackPtr;
236 $lastComment = $stackPtr;
248 for ($i = $topComment; $i <= $stackPtr; $i++) {
256 $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Empty');
258 $phpcsFile->fixer->replaceToken($stackPtr, '');
288 $phpcsFile->addError($error, $stackPtr, 'InvalidEndChar', $data);
294 if ($tokens[$previousContent]['line'] < $tokens[$stackPtr]['line']) {
296 for ($i = ($stackPtr + 1); $i < $phpcsFile->numTokens; $i++) {
297 if ($tokens[$i]['line'] === ($tokens[$stackPtr]['line'] + 1)) {
301 } else if ($tokens[$i]['line'] > ($tokens[$stackPtr]['line'] + 1)) {
307 $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingAfter');
309 $next = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true);
311 for ($i = ($stackPtr + 1); $i < $next; $i++) {