Lines Matching refs:stackPtr
60 * @param int $stackPtr The position of the current token
65 public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) argument
70 if ($tokens[($stackPtr - 1)]['code'] !== T_WHITESPACE) {
72 $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoSpaceBefore');
74 $phpcsFile->fixer->addContentBefore($stackPtr, ' ');
77 $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true);
78 if ($tokens[$stackPtr]['line'] === $tokens[$prev]['line']
79 && strlen($tokens[($stackPtr - 1)]['content']) !== 1
81 $found = strlen($tokens[($stackPtr - 1)]['content']);
84 … $fix = $phpcsFile->addFixableError($error, $stackPtr, 'TooMuchSpaceBefore', $data);
86 $phpcsFile->fixer->replaceToken(($stackPtr - 1), ' ');
92 if ($tokens[($stackPtr + 1)]['code'] !== T_WHITESPACE) {
94 $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoSpaceAfter');
96 $phpcsFile->fixer->addContent($stackPtr, ' ');
99 $next = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true);
100 if ($tokens[$stackPtr]['line'] === $tokens[$next]['line']
101 && strlen($tokens[($stackPtr + 1)]['content']) !== 1
103 $found = strlen($tokens[($stackPtr + 1)]['content']);
106 $fix = $phpcsFile->addFixableError($error, $stackPtr, 'TooMuchSpaceAfter', $data);
108 $phpcsFile->fixer->replaceToken(($stackPtr + 1), ' ');