@param \PHP_CodeSniffer\Files\File $phpCsFile
@param array $first
@param array $second

@return void
16591
protected function assertNoSpacing(File $phpCsFile, array $first, array $second): void
    {
        $tokens = $phpCsFile->getTokens();

        $lastIndexOfFirst = $first['tagEnd'];
        $lastLineOfFirst = $tokens[$lastIndexOfFirst]['line'];

        $tagIndexOfSecond = $second['index'];
        $firstLineOfSecond = $tokens[$tagIndexOfSecond]['line'];

        if ($lastLineOfFirst === $firstLineOfSecond - 1) {
            return;
        }

        $fix = $phpCsFile->addFixableError('No newline expected between tags of the same type `' . $first['tag'] . '`', $tagIndexOfSecond, 'NoNewlineBetweenSameType');
        if (!$fix) {
            return;
        }

        $phpCsFile->fixer->beginChangeset();

        for ($i = $first['tagEnd'] + 1; $i < $second['start']; $i++) {
            if ($tokens[$i]['line'] <= $lastLineOfFirst || $tokens[$i]['line'] >= $firstLineOfSecond) {
                continue;
            }

            $phpCsFile->fixer->replaceToken($i, '');
        }

        $phpCsFile->fixer->endChangeset();
    }
926205
protected function findUnnecessaryLeadingComparisonStart(File $phpcsFile, int $index): ?int
    {
        $tokens = $phpcsFile->getTokens();

        $previous = (int)$phpcsFile->findPrevious(T_WHITESPACE, ($index - 1), null, true);
        if (!$previous || !in_array($tokens[$previous]['code'], [T_IS_IDENTICAL, T_IS_NOT_IDENTICAL])) {
            return null;
        }

        $previous = (int)$phpcsFile->findPrevious(T_WHITESPACE, ($previous - 1), null, true);
        if (!$previous || !in_array($tokens[$previous]['code'], [T_TRUE, T_FALSE])) {
            return null;
        }

        return $previous;
    }
651194
protected function assertNewLineAtTheEnd(File $phpCsFile, int $closingBraceIndex, ?int $nextContentIndex): void
    {
        $tokens = $phpCsFile->getTokens();

        if (!$nextContentIndex || $tokens[$nextContentIndex]['line'] - $tokens[$closingBraceIndex]['line'] <= 1) {
            $fix = $phpCsFile->addFixableError('Every function/method needs a newline afterwards', $closingBraceIndex, 'Concrete');
            if ($fix) {
                $phpCsFile->fixer->addNewline($closingBraceIndex);
            }
        }
    }
507635
public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
    {
        $tokens = $phpcsFile->getTokens();
        $arrayStart = DWS_Helpers_Bracket::bracketStart($phpcsFile, $stackPtr);
        $arrayEnd = DWS_Helpers_Bracket::bracketEnd($phpcsFile, $stackPtr);

        $isSingleLine = $tokens[$arrayStart]['line'] === $tokens[$arrayEnd]['line'];

        foreach (DWS_Helpers_Array::commaPositions($phpcsFile, $arrayStart) as $comma) {
            if ($tokens[$comma - 1]['code'] === T_WHITESPACE) {
                $phpcsFile->addError('No whitespace allowed before commas in an array', $comma, 'SpaceBeforeComma');
            }

            if ($isSingleLine) {
                if ($tokens[$comma + 1]['content'] !== ' ') {
                    $phpcsFile->addError('Expected 1 space after comma in single-line array', $comma, 'SingleLineSpaceAfterComma');
                }
            } elseif ($tokens[$comma + 1]['content'][0] !== "\n") {
                $nextMember = $phpcsFile->findNext([T_WHITESPACE, T_COMMENT], $comma + 1, $arrayEnd, true);
                if ($nextMember !== false && $tokens[$nextMember]['line'] === $tokens[$comma]['line']) {
                    $phpcsFile->addError('Comma in multi-line array was not last token on line', $comma, 'MultiLineNewlineAfterComma');
                }
            }
        }
    }
988169
protected function processAuthor(PHP_CodeSniffer_File $phpcsFile, array $tags)
	{
		$tokens = $phpcsFile->getTokens();

		foreach ($tags as $tag)
		{
			if ($tokens[($tag + 2)]['code'] !== T_DOC_COMMENT_STRING)
			{
				// No content.
				continue;
			}

			$content = $tokens[($tag + 2)]['content'];
			$local   = '\da-zA-Z-_+';

			// Dot character cannot be the first or last character in the local-part.
			$localMiddle = $local . '.\w';

			if (preg_match(
				'/^([^<]*)\s+<([' . $local . ']([' . $localMiddle . ']*[' . $local . '])*@[\da-zA-Z][-.\w]*[\da-zA-Z]\.[a-zA-Z]{2,7})>$/',
				$content
			) === 0)
			{
				$error = 'Content of the @author tag must be in the form "Display Name <username@example.com>"';
				$phpcsFile->addError($error, $tag, 'InvalidAuthors');
			}
		}
	}
159035
public function process(File $phpcsFile, $stackPtr)
    {
        $traitName    = $phpcsFile->getDeclarationName($stackPtr);
        $firstLetter  = $traitName[0];
        $secondLetter = $traitName[1];

        if ($firstLetter !== 'T' || $secondLetter === strtolower($secondLetter)) {
            $phpcsFile->addError(
                'Trait name is not prefixed with "T"',
                $stackPtr,
                'WrongPrefix'
            );
        }
    }
369558
public function process(File $phpcsFile, $stackPtr)
    {
        if ($this->supportsAbove('7.0') === false) {
            return;
        }

        $tokens = $phpcsFile->getTokens();

        // Determine the start and end of the part of the statement we need to examine.
        $start = ($stackPtr + 1);
        $next  = $phpcsFile->findNext(Tokens::$emptyTokens, $start, null, true);
        if ($next !== false && $tokens[$next]['code'] === \T_OPEN_PARENTHESIS) {
            $start = ($next + 1);
        }

        $end = PHPCSHelper::findEndOfStatement($phpcsFile, $start);
        if (isset($this->inclusiveStopPoints[$tokens[$end]['code']]) === true) {
            --$end;
        }

        if ($this->isNegativeNumber($phpcsFile, $start, $end, true) !== true) {
            // Not a negative number or undetermined.
            return;
        }

        $phpcsFile->addError(
            'Bitwise shifts by negative number will throw an ArithmeticError in PHP 7.0. Found: %s',
            $stackPtr,
            'Found',
            array($phpcsFile->getTokensAsString($start, ($end - $start + 1)))
        );
    }
282251
public function process( PHP_CodeSniffer_File $phpcsFile, $stackPtr ) {
		$tokens = $phpcsFile->getTokens();

		if ( $tokens[( $stackPtr + 1 )]['code'] !== T_WHITESPACE
			&& ! ( $tokens[$stackPtr]['code'] === T_ELSE && $tokens[( $stackPtr + 1 )]['code'] === T_COLON )
			&& ! ( T_CLOSURE === $tokens[ $stackPtr ]['code'] && 0 === (int) $this->spaces_before_closure_open_paren )
		) {
			$error = 'Space after opening control structure is required';

			if ( isset( $phpcsFile->fixer ) === true ) {
				$fix = $phpcsFile->addFixableError( $error, $stackPtr, 'NoSpaceAfterStructureOpen' );

				if ( $fix === true ) {
					$phpcsFile->fixer->beginChangeset();
					$phpcsFile->fixer->addContent( $stackPtr, ' ' );
					$phpcsFile->fixer->endChangeset();
				}
			} else {
				$phpcsFile->addError( $error, $stackPtr, 'NoSpaceAfterStructureOpen' );
			}
		}

		if ( isset( $tokens[ $stackPtr ] ) && isset( $tokens[ $stackPtr ]['scope_closer'] ) === false ) {
			if ( T_USE === $tokens[ $stackPtr ]['code'] ) {
				$scopeOpener = $phpcsFile->findNext( T_OPEN_CURLY_BRACKET, $stackPtr + 1 );
				$scopeCloser = isset( $tokens[ $scopeOpener ]['scope_closer'] ) ? $tokens[ $scopeOpener ]['scope_closer'] : null;
			} else {
				return;
			}
		} else {
			$scopeOpener = isset( $tokens[ $stackPtr ]['scope_opener'] ) ? $tokens[ $stackPtr ]['scope_opener'] : null;
			$scopeCloser = isset( $tokens[ $stackPtr ]['scope_closer'] ) ? $tokens[ $stackPtr ]['scope_closer'] : null;
		}

		$firstContent = $phpcsFile->findNext( T_WHITESPACE, ( $scopeOpener + 1 ), null, true );
		$currentToken = $tokens[$scopeOpener];
		$class_line = array_values( array_filter( array_filter( $tokens, function ( $token ) use( $currentToken ) {
			return $token['line'] === $currentToken['line'];
		} ), function ( $token ) {
			return $token['code'] === T_CLASS;
		} ) );

		if ( count( $class_line ) > 0 ) {
			$next_line = array_filter( $tokens, function ( $token ) use( $class_line ) {
				return $token['line'] === $class_line[0]['line'] + 1;
			} );

			if ( count( $next_line ) > 0 ) {
				$whitespace = array_filter( $next_line, function ( $token ) {
					return $token['code'] === T_WHITESPACE;
				} );

				$whitespace = count( $whitespace ) < count( $next_line );

				if ( $whitespace
					&& $tokens[$scopeOpener]['code'] === T_OPEN_CURLY_BRACKET
					&& ! isset( $tokens[$firstContent]['nested_parenthesis'] )
					&& $tokens[$firstContent]['level'] === 1
				) {
					$error = 'No blank line found at start of control structure';

					if ( isset( $phpcsFile->fixer ) === true ) {
						$fix = $phpcsFile->addFixableError( $error, $scopeOpener, 'NoBlankLineAfterStart' );

						if ( $fix === true ) {
							$phpcsFile->fixer->beginChangeset();

							for ( $i = ( $scopeOpener + 2 ); $i < $firstContent; $i++ ) {
								$phpcsFile->fixer->replaceToken( $i, '' );
							}

							$phpcsFile->fixer->addNewline( $scopeOpener );
							$phpcsFile->fixer->endChangeset();
						}
					} else {
						$phpcsFile->addError( $error, $scopeOpener, 'NoBlankLineAfterStart' );
					}
				}

				$next_line = array_values( $next_line );

				$next_next_line = array_filter( $tokens, function ( $token ) use ( $next_line ) {
					return $token['line'] === $next_line[0]['line'] + 1;
				} );

				if ( count( $next_next_line )  > 0 ) {
					$next_whitespace = array_filter( $next_next_line, function ( $token ) {
						return $token['code'] === T_WHITESPACE;
					} );

					$next_whitespace = count( $next_next_line ) === count( $next_whitespace );

					if ( $next_whitespace
						&& $tokens[$scopeOpener]['code'] === T_OPEN_CURLY_BRACKET
						&& ! isset( $tokens[$firstContent]['nested_parenthesis'] )
						&& $tokens[$firstContent]['level'] === 1
					) {
						$error = 'More then one blank line found at start of control structure';

						if ( isset( $phpcsFile->fixer ) === true ) {
							$fix = $phpcsFile->addFixableError( $error, $scopeOpener, 'MoreThenOneBlankLineAfterStart' );

							if ( $fix === true ) {
								$phpcsFile->fixer->beginChangeset();

								for ( $i = ( $scopeOpener + 2 ); $i < $firstContent; $i++ ) {
									$phpcsFile->fixer->replaceToken( $i, '' );
								}

								$phpcsFile->fixer->addNewline( $scopeOpener );
								$phpcsFile->fixer->endChangeset();
							}
						} else {
							$phpcsFile->addError( $error, $scopeOpener, 'MoreThenOneBlankLineAfterStart' );
						}
					}
				}
			}
		}

		$trailingContent = $phpcsFile->findNext( T_WHITESPACE, ( $scopeCloser + 1 ), null, true );

		if ( $tokens[$trailingContent]['code'] === T_ELSE ) {
			if ( $tokens[$stackPtr]['code'] === T_IF ) {
				// IF with ELSE.
				return;
			}
		}

		if ( $tokens[$trailingContent]['code'] === T_COMMENT ) {
			if ( $tokens[$trailingContent]['line'] === $tokens[$scopeCloser]['line'] ) {
				if ( substr( $tokens[$trailingContent]['content'], 0, 5 ) === '//end' ) {
					// There is an end comment, so we have to get the next piece
					// of content.
					$trailingContent = $phpcsFile->findNext( T_WHITESPACE, ( $trailingContent + 1 ), null, true );
				}
			}
		}

		if ( $tokens[$trailingContent]['code'] === T_BREAK ) {
			// If this BREAK is closing a CASE, we don't need the
			// blank line after this control structure.
			if ( isset( $tokens[$trailingContent]['scope_condition'] ) === true ) {
				$condition = $tokens[$trailingContent]['scope_condition'];

				if ( $tokens[$condition]['code'] === T_CASE || $tokens[$condition]['code'] === T_DEFAULT ) {
					return;
				}
			}
		}
	}
705286
public function process(File $phpcsFile, $stackPtr)
    {
        $tokens = $phpcsFile->getTokens();

        // Find the next non-empty token.
        $openBracket = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true);

        if ($tokens[$openBracket]['code'] !== T_OPEN_PARENTHESIS) {
            // Not a function call.
            return;
        }

        if (isset($tokens[$openBracket]['parenthesis_closer']) === false) {
            // Not a function call.
            return;
        }

        // Find the previous non-empty token.
        $search   = Tokens::$emptyTokens;
        $search[] = T_BITWISE_AND;
        $previous = $phpcsFile->findPrevious($search, ($stackPtr - 1), null, true);
        if ($tokens[$previous]['code'] === T_FUNCTION) {
            // It's a function definition, not a function call.
            return;
        }

        if ($tokens[$previous]['code'] === T_NEW) {
            // We are creating an object, not calling a function.
            return;
        }

        $closeBracket = $tokens[$openBracket]['parenthesis_closer'];

        if (($stackPtr + 1) !== $openBracket) {
            // Checking this: $value = my_function[*](...).
            $error = 'Space before opening parenthesis of function call prohibited';
            $phpcsFile->addError($error, $stackPtr, 'SpaceBeforeOpenBracket');
        }

        $next = $phpcsFile->findNext(T_WHITESPACE, ($closeBracket + 1), null, true);
        if ($tokens[$next]['code'] === T_SEMICOLON) {
            if (in_array($tokens[($closeBracket + 1)]['code'], Tokens::$emptyTokens) === true) {
                $error = 'Space after closing parenthesis of function call prohibited';
                $phpcsFile->addError($error, $closeBracket, 'SpaceAfterCloseBracket');
            }
        }

        // Check if this is a single line or multi-line function call.
        if ($tokens[$openBracket]['line'] === $tokens[$closeBracket]['line']) {
            $this->processSingleLineCall($phpcsFile, $stackPtr, $openBracket, $tokens);
        } else {
            $this->processMultiLineCall($phpcsFile, $stackPtr, $openBracket, $tokens);
        }
    }
899629
public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
    {
        $tokens    = $phpcsFile->getTokens();
        $nextToken = $phpcsFile->findNext(PHP_CodeSniffer_Tokens::$emptyTokens, ($stackPtr + 1), null, true);

        if ($tokens[$nextToken]['code'] === T_OPEN_PARENTHESIS)
        {
            $error = '"%s" is a statement not a function; no parentheses are required';
            $data  = [$tokens[$stackPtr]['content']];
            $fix   = $phpcsFile->addFixableError($error, $stackPtr, 'BracketsNotRequired', $data);

            if ($fix === true)
            {
                $end      = $phpcsFile->findEndOfStatement($nextToken);
                $ignore   = PHP_CodeSniffer_Tokens::$emptyTokens;
                $ignore[] = T_SEMICOLON;
                $closer   = $phpcsFile->findPrevious($ignore, ($end - 1), null, true);

                $phpcsFile->fixer->beginChangeset();
                $phpcsFile->fixer->replaceToken($nextToken, '');

                if ($tokens[($stackPtr + 1)]['code'] === T_WHITESPACE)
                {
                    $phpcsFile->fixer->replaceToken(($stackPtr + 1), '');
                }

                if ($tokens[$closer]['code'] === T_CLOSE_PARENTHESIS)
                {
                    $phpcsFile->fixer->replaceToken($closer, '');
                }

                $phpcsFile->fixer->addContent($stackPtr, ' ');
                $phpcsFile->fixer->endChangeset();
            }
        }
    }
634230
public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) {
        $this->currentFile = $phpcsFile;

        // We are only interested if this is the first open tag.
        if ($stackPtr !== 0) {
            if ($phpcsFile->findPrevious(T_OPEN_TAG, ($stackPtr - 1)) !== false) {
                return;
            }
        }

        $tokens = $phpcsFile->getTokens();

        // Find the next non whitespace token.
        $commentStart = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true);

        // Allow declare() statements at the top of the file.
        if ($tokens[$commentStart]['code'] === T_DECLARE) {
            $semicolon = $phpcsFile->findNext(T_SEMICOLON, ($commentStart + 1));
            $commentStart = $phpcsFile->findNext(T_WHITESPACE, ($semicolon + 1), null, true);
        }

        // Ignore vim header.
        if ($tokens[$commentStart]['code'] === T_COMMENT) {
            if (strstr($tokens[$commentStart]['content'], 'vim:') !== false) {
                $commentStart = $phpcsFile->findNext(T_WHITESPACE, ($commentStart + 1), null, true);
            }
        }

        $errorToken = ($stackPtr + 1);
        if (isset($tokens[$errorToken]) === false) {
            $errorToken--;
        }

        if ($tokens[$commentStart]['code'] === T_CLOSE_TAG) {
            // We are only interested if this is the first open tag.
            return;
        } else if ($tokens[$commentStart]['code'] === T_COMMENT) {
            $error = 'You must use "/**" style comments for a file comment';
            $phpcsFile->addError($error, $errorToken, 'WrongStyle');
            return;
        } else if ($commentStart === false || $tokens[$commentStart]['code'] !== T_DOC_COMMENT) {
            $phpcsFile->addError('Missing file doc comment', $errorToken, 'Missing');
            return;
        } else {

            // Extract the header comment docblock.
            $commentEnd = $phpcsFile->findNext(T_DOC_COMMENT, ($commentStart + 1), null, true);

            $commentEnd--;

            // Check if there is only 1 doc comment between the
            // open tag and class token.
            $nextToken = array(T_ABSTRACT, T_CLASS, T_FUNCTION, T_DOC_COMMENT,);

            $commentNext = $phpcsFile->findNext($nextToken, ($commentEnd + 1));
            if ($commentNext !== false && $tokens[$commentNext]['code'] !== T_DOC_COMMENT) {
                // Found a class token right after comment doc block.
                $newlineToken = $phpcsFile->findNext(T_WHITESPACE, ($commentEnd + 1), $commentNext, false,
                    $phpcsFile->eolChar);

                if ($newlineToken !== false) {
                    $newlineToken = $phpcsFile->findNext(T_WHITESPACE, ($newlineToken + 1), $commentNext, false,
                        $phpcsFile->eolChar);

                    if ($newlineToken === false) {
                        // No blank line between the class token and the doc block.
                        // The doc block is most likely a class comment.
                        $error = 'Missing file doc comment';
                        $phpcsFile->addError($error, $errorToken, 'Missing');
                        return;
                    }
                }
            }//end if

            $comment = $phpcsFile->getTokensAsString($commentStart, ($commentEnd - $commentStart + 1));

            // Parse the header comment docblock.
            try {
                $this->commentParser = new PHP_CodeSniffer_CommentParser_ClassCommentParser($comment, $phpcsFile);
                $this->commentParser->parse();
            } catch (PHP_CodeSniffer_CommentParser_ParserException $e) {
                $line = ($e->getLineWithinComment() + $commentStart);
                $phpcsFile->addError($e->getMessage(), $line, 'FailedParse');
                return;
            }

            $comment = $this->commentParser->getComment();
            if (is_null($comment) === true) {
                $error = 'File doc comment is empty';
                $phpcsFile->addError($error, $commentStart, 'Empty');
                return;
            }

            // No extra newline before short description.
            $short = $comment->getShortComment();
            $newlineCount = 0;
            $newlineSpan = strspn($short, $phpcsFile->eolChar);
            if ($short !== '' && $newlineSpan > 0) {
                $error = 'Extra newline(s) found before file comment short description';
                $phpcsFile->addError($error, ($commentStart + 1), 'SpacingBefore');
            }

            $newlineCount = (substr_count($short, $phpcsFile->eolChar) + 1);

            // Exactly one blank line between short and long description.
            $long = $comment->getLongComment();
            if (empty($long) === false) {
                $between = $comment->getWhiteSpaceBetween();
                $newlineBetween = substr_count($between, $phpcsFile->eolChar);
                if ($newlineBetween !== 2) {
                    $error = 'There must be exactly one blank line between descriptions in file comment';
                    $phpcsFile->addError($error, ($commentStart + $newlineCount + 1), 'DescriptionSpacing');
                }

                $newlineCount += $newlineBetween;
            }

            // Exactly one blank line before tags.
            $tags = $this->commentParser->getTagOrders();
            if (count($tags) > 1) {
                $newlineSpan = $comment->getNewlineAfter();
                if ($newlineSpan !== 2) {
                    $error = 'There must be exactly one blank line before the tags in file comment';
                    if ($long !== '') {
                        $newlineCount += (substr_count($long, $phpcsFile->eolChar) - $newlineSpan + 1);
                    }

                    $phpcsFile->addError($error, ($commentStart + $newlineCount), 'SpacingBeforeTags');
                    $short = rtrim($short, $phpcsFile->eolChar . ' ');
                }
            }

            // Check the PHP Version.
            $this->processPHPVersion($commentStart, $commentEnd, $long);

            // Check each tag.
            $this->processTags($commentStart, $commentEnd);
        }//end if

    }
1231398
protected function insertDocBlock(File $phpCsFile, int $docBlockStartPosition): void
    {
        $phpCsFile->fixer->addContent($docBlockStartPosition, '/**');
        $phpCsFile->fixer->addNewline($docBlockStartPosition);
        $phpCsFile->fixer->addContent($docBlockStartPosition, ' * ' . static::EXPLANATION_CONSTANTS_INTERFACE);
        $phpCsFile->fixer->addNewline($docBlockStartPosition);
        $phpCsFile->fixer->addContent($docBlockStartPosition, ' */');
    }
148848
public function process(File $phpcsFile, $stackPtr)
    {
        $this->requiredSpacesAfterOpen   = (int) $this->requiredSpacesAfterOpen;
        $this->requiredSpacesBeforeClose = (int) $this->requiredSpacesBeforeClose;
        $tokens = $phpcsFile->getTokens();

        $this->checkBracketSpacing($phpcsFile, $stackPtr);

        if (isset($tokens[$stackPtr]['scope_closer']) === false) {
            return;
        }

        $this->checkContentInside($phpcsFile, $stackPtr);
        $this->checkLeadingContent($phpcsFile, $stackPtr);
        $this->checkTrailingContent($phpcsFile, $stackPtr);
    }
1170404
protected function isInterface(PHP_CodeSniffer_File $phpcsFile) {
        $checkFile = "". $phpcsFile->getFilename();
        if (isset($this->isFileInterface[$checkFile])) {
            return (bool) $this->isFileInterface[$checkFile];
        }

        $interface = $phpcsFile->findNext(T_INTERFACE, 0);

        return $this->isFileInterface[$checkFile] = (bool)(empty($interface) == false);
    }
365143
public function process(File $phpcsFile, $stackPtr)
    {
        if ($this->supportsBelow('5.6') !== true) {
            return;
        }

        $tokens = $phpcsFile->getTokens();

        $ignore = array(
            \T_DOUBLE_COLON    => true,
            \T_OBJECT_OPERATOR => true,
            \T_FUNCTION        => true,
            \T_CONST           => true,
        );

        $prevToken = $phpcsFile->findPrevious(\T_WHITESPACE, ($stackPtr - 1), null, true);
        if (isset($ignore[$tokens[$prevToken]['code']]) === true) {
            // Not a call to a PHP function.
            return;
        }

        $functionLc = strtolower($tokens[$stackPtr]['content']);
        if ($functionLc !== 'define') {
            return;
        }

        $secondParam = $this->getFunctionCallParameter($phpcsFile, $stackPtr, 2);
        if (isset($secondParam['start'], $secondParam['end']) === false) {
            return;
        }

        $targetNestingLevel = 0;
        if (isset($tokens[$secondParam['start']]['nested_parenthesis'])) {
            $targetNestingLevel = \count($tokens[$secondParam['start']]['nested_parenthesis']);
        }

        $array = $phpcsFile->findNext(array(\T_ARRAY, \T_OPEN_SHORT_ARRAY), $secondParam['start'], ($secondParam['end'] + 1));
        if ($array !== false) {
            if ((isset($tokens[$array]['nested_parenthesis']) === false && $targetNestingLevel === 0) || \count($tokens[$array]['nested_parenthesis']) === $targetNestingLevel) {
                $phpcsFile->addError(
                    'Constant arrays using define are not allowed in PHP 5.6 or earlier',
                    $array,
                    'Found'
                );
            }
        }
    }
250000
public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) {
		$tokens = $phpcsFile->getTokens();
		$token = $tokens[$stackPtr];
		// Skip for-loop without body.
		if (isset($token['parenthesis_opener']) === false) {
			return;
		}
		$next = ++$token['parenthesis_opener'];
		$end = --$token['parenthesis_closer'];
		$goodCondition = false;
		for (; $next <= $end; ++$next) {
			$code = $tokens[$next]['code'];
			if (isset(PHP_CodeSniffer_Tokens::$emptyTokens[$code])) {
				continue;
			} else if (!in_array($code, array(T_TRUE, T_FALSE, T_LNUMBER, T_CONSTANT_ENCAPSED_STRING, T_STRING))) {
				$goodCondition = true;
				break;
			}
		}
		if (!$goodCondition) {
			$error = 'Avoid IF statements that are always true or false';
			$phpcsFile->addError($error, $stackPtr, 'Found');
		}
	}
899465
public function process(File $phpcsFile, $stackPtr)
    {
        $nextClass = $phpcsFile->findNext($this->register(), ($stackPtr + 1));
        if ($nextClass !== false) {
            $error = 'Only one trait is allowed in a file';
            $phpcsFile->addError($error, $nextClass, 'MultipleFound');
        }
    }