Lines Matching refs:tokens

95         $tokens = $phpcsFile->getTokens();
100 if ($tokens[$openBracket]['code'] !== T_OPEN_PARENTHESIS) {
105 if (isset($tokens[$openBracket]['parenthesis_closer']) === false) {
114 if ($tokens[$previous]['code'] === T_FUNCTION) {
119 $closeBracket = $tokens[$openBracket]['parenthesis_closer'];
139 if ($tokens[$next]['code'] === T_SEMICOLON) {
140 … if (isset(PHP_CodeSniffer_Tokens::$emptyTokens[$tokens[($closeBracket + 1)]['code']]) === true) {
158 if ($this->isMultiLineCall($phpcsFile, $stackPtr, $openBracket, $tokens) === true) {
159 $this->processMultiLineCall($phpcsFile, $stackPtr, $openBracket, $tokens);
161 $this->processSingleLineCall($phpcsFile, $stackPtr, $openBracket, $tokens);
175 * @param array $tokens The stack of tokens that make up
180 … public function isMultiLineCall(PHP_CodeSniffer_File $phpcsFile, $stackPtr, $openBracket, $tokens) argument
182 $closeBracket = $tokens[$openBracket]['parenthesis_closer'];
183 if ($tokens[$openBracket]['line'] !== $tokens[$closeBracket]['line']) {
200 * @param array $tokens The stack of tokens that make up
205 …c function processSingleLineCall(PHP_CodeSniffer_File $phpcsFile, $stackPtr, $openBracket, $tokens) argument
207 $closer = $tokens[$openBracket]['parenthesis_closer'];
212 …if ($this->requiredSpacesAfterOpen === 0 && $tokens[($openBracket + 1)]['code'] === T_WHITESPACE) {
221 if ($tokens[($openBracket + 1)]['code'] === T_WHITESPACE) {
222 $spaceAfterOpen = strlen($tokens[($openBracket + 1)]['content']);
246 if ($tokens[$prev]['code'] === T_END_HEREDOC || $tokens[$prev]['code'] === T_END_NOWDOC) {
251 if ($tokens[$prev]['line'] !== $tokens[$closer]['line']) {
253 } else if ($tokens[($closer - 1)]['code'] === T_WHITESPACE) {
254 $spaceBeforeClose = strlen($tokens[($closer - 1)]['content']);
275 if ($tokens[$next]['code'] === T_SEMICOLON) {
285 … while (isset(PHP_CodeSniffer_Tokens::$emptyTokens[$tokens[$prev]['code']]) === true) {
286 if (($tokens[$prev]['code'] === T_COMMENT)
287 && (strpos($tokens[$prev]['content'], '*/') !== false)
320 * @param array $tokens The stack of tokens that make up
325 …ic function processMultiLineCall(PHP_CodeSniffer_File $phpcsFile, $stackPtr, $openBracket, $tokens) argument
334 if ($tokens[$i]['line'] !== $tokens[$x]['line']) {
342 } else if ($tokens[$i]['code'] === T_WHITESPACE) {
343 $functionIndent = strlen($tokens[$i]['content']);
344 } else if ($tokens[$i]['code'] === T_CONSTANT_ENCAPSED_STRING) {
347 $trimmed = ltrim($tokens[$i]['content']);
349 if ($tokens[$i]['code'] === T_INLINE_HTML) {
350 $functionIndent = strlen($tokens[$i]['content']);
352 $functionIndent = ($tokens[$i]['column'] - 1);
355 $functionIndent = (strlen($tokens[$i]['content']) - strlen($trimmed));
366 if ($tokens[$next]['line'] === $tokens[$openBracket]['line']) {
377 $closeBracket = $tokens[$openBracket]['parenthesis_closer'];
379 if ($tokens[$prev]['line'] === $tokens[$closeBracket]['line']) {
391 $lastLine = ($tokens[$openBracket]['line'] - 1);
398 if ($tokens[($i - 1)]['code'] === T_WHITESPACE
399 && $tokens[($i - 1)]['line'] === $tokens[$i]['line']
412 if ($tokens[$i]['line'] !== $lastLine) {
413 $lastLine = $tokens[$i]['line'];
416 if (isset(PHP_CodeSniffer_Tokens::$heredocTokens[$tokens[$i]['code']]) === true) {
421 if (isset(PHP_CodeSniffer_Tokens::$stringTokens[$tokens[$i]['code']]) === true
422 && $tokens[$i]['code'] === $tokens[($i - 1)]['code']
428 if ($tokens[$i]['code'] === T_INLINE_HTML) {
432 if ($tokens[$i]['line'] !== $tokens[$openBracket]['line']) {
436 if ($tokens[$i]['code'] === T_WHITESPACE) {
438 if ($tokens[$nextCode]['line'] !== $lastLine) {
453 if ($tokens[$nextCode]['line'] === $tokens[$closeBracket]['line']) {
462 if ($tokens[$i]['code'] !== T_WHITESPACE
463 && $tokens[$i]['code'] !== T_DOC_COMMENT_WHITESPACE
467 if ($tokens[$i]['code'] === T_COMMENT
468 && $tokens[($i - 1)]['code'] === T_COMMENT
470 $trimmedLength = strlen(ltrim($tokens[$i]['content']));
477 $foundIndent = (strlen($tokens[$i]['content']) - $trimmedLength);
482 $foundIndent = strlen($tokens[$i]['content']);
501 if ($tokens[$i]['code'] === T_COMMENT) {
502 $comment = $padding.ltrim($tokens[$i]['content']);
522 if ($inArg === false && $tokens[$i]['code'] === T_COMMA) {
530 if ($tokens[$i]['line'] === $tokens[$next]['line']) {
536 if ($tokens[$x]['code'] !== T_WHITESPACE) {