Lines Matching refs:tokens

57         $tokens = $phpcsFile->getTokens();
62 if ($closeTag === false || $tokens[$stackPtr]['line'] !== $tokens[$closeTag]['line']) {
82 $tokens = $phpcsFile->getTokens();
116 if ($tokens[$firstContent]['line'] === $tokens[$stackPtr]['line']) {
121 … $padding = (strlen($tokens[$first]['content']) - strlen(ltrim($tokens[$first]['content'])));
129 if (isset($tokens[$firstContent]['scope_closer']) === false
130 || $tokens[$firstContent]['scope_closer'] !== $firstContent
133 if ($tokens[$firstContent]['line'] > ($tokens[$stackPtr]['line'] + 1)) {
138 } while ($tokens[$i]['line'] !== ($tokens[$stackPtr]['line'] + 1));
145 if ($tokens[$i]['line'] === $tokens[$firstContent]['line']
146 || $tokens[$i]['line'] === $tokens[$stackPtr]['line']
161 … $indent = (strlen($tokens[$first]['content']) - strlen(ltrim($tokens[$first]['content'])));
163 $indent = ($tokens[($first + 1)]['column'] - 1);
166 $contentColumn = ($tokens[$firstContent]['column'] - 1);
187 if ($tokens[$lastContent]['line'] === $tokens[$stackPtr]['line']
188 && trim($tokens[$lastContent]['content']) !== ''
196 … $padding = (strlen($tokens[$first]['content']) - strlen(ltrim($tokens[$first]['content'])));
198 $padding = ($tokens[($first + 1)]['column'] - 1);
206 if ($tokens[$first]['line'] === $tokens[$stackPtr]['line']) {
208 } else if (trim($tokens[$first]['content']) !== '') {
215 if ($tokens[$first]['code'] === T_INLINE_HTML
216 && trim($tokens[$first]['content']) !== ''
218 … $expected = (strlen($tokens[$first]['content']) - strlen(ltrim($tokens[$first]['content'])));
219 } else if ($tokens[$first]['code'] === T_WHITESPACE) {
220 $expected = ($tokens[($first + 1)]['column'] - 1);
224 $found = ($tokens[$stackPtr]['column'] - 1);
245 if ($tokens[$lastContent]['line'] === $tokens[$closingTag]['line']) {
251 …$phpcsFile->fixer->addContentBefore($closingTag, str_repeat(' ', ($tokens[$first]['column'] - 1)));
255 } else if ($tokens[$nextContent]['line'] === $tokens[$closingTag]['line']) {
262 … $phpcsFile->fixer->addContent($closingTag, str_repeat(' ', ($tokens[$first]['column'] - 1)));
273 if ((isset($tokens[$lastContent]['scope_closer']) === false
274 || $tokens[$lastContent]['scope_closer'] !== $lastContent)
275 && $tokens[$lastContent]['line'] < ($tokens[$closingTag]['line'] - 1)
281 } while ($tokens[$i]['line'] !== ($tokens[$closingTag]['line'] - 1));
288 if ($tokens[$i]['line'] === $tokens[$lastContent]['line']
289 || $tokens[$i]['line'] === $tokens[$closingTag]['line']
315 $tokens = $phpcsFile->getTokens();
320 if ($tokens[$stackPtr]['line'] !== $tokens[$closeTag]['line']) {
344 if ($tokens[($stackPtr + 1)]['code'] === T_WHITESPACE) {
345 $leadingSpace = (strlen($tokens[($stackPtr + 1)]['content']) + 1);
358 if ((isset($tokens[$prev]['scope_opener']) === false
359 || $tokens[$prev]['scope_opener'] !== $prev)
360 && (isset($tokens[$prev]['scope_closer']) === false
361 || $tokens[$prev]['scope_closer'] !== $prev)
362 && $tokens[$prev]['code'] !== T_SEMICOLON
369 } else if ($tokens[$prev]['code'] === T_SEMICOLON) {
372 if ($tokens[$i]['code'] === T_SEMICOLON) {
385 if ($tokens[($closeTag - 1)]['code'] === T_WHITESPACE) {
386 $trailingSpace = strlen($tokens[($closeTag - 1)]['content']);