Lines Matching refs:stackPtr
76 * @param int $stackPtr The position of the current token in the
81 public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) argument
85 if (isset($tokens[$stackPtr]['scope_opener']) === true) {
86 $phpcsFile->recordMetric($stackPtr, 'Control structure defined inline', 'no');
91 if ($tokens[$stackPtr]['code'] === T_ELSE) {
92 $next = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true);
98 if ($tokens[$stackPtr]['code'] === T_WHILE) {
100 $lastContent = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true);
116 $lastDo = $phpcsFile->findPrevious(T_DO, ($stackPtr - 1));
117 $lastSemicolon = $phpcsFile->findPrevious(T_SEMICOLON, ($stackPtr - 1));
130 … $phpcsFile->addFixableError('Inline control structures are not allowed', $stackPtr, 'NotAllowed');
132 …hpcsFile->addFixableWarning('Inline control structures are discouraged', $stackPtr, 'Discouraged');
135 $phpcsFile->recordMetric($stackPtr, 'Control structure defined inline', 'yes');
143 if (isset($tokens[$stackPtr]['parenthesis_closer']) === true) {
144 $closer = $tokens[$stackPtr]['parenthesis_closer'];
146 $closer = $stackPtr;
278 for ($first = $stackPtr; $first > 0; $first--) {