{@inheritdoc}

@param File $phpcsFile
@param int  $stackPointer

@return void
173183
public function process(File $phpcsFile, $stackPointer)
    {
        $tokens = $phpcsFile->getTokens();
        // We are only interested in the first token in a multi-line string.
        if ($tokens[$stackPointer]['code'] === $tokens[$stackPointer - 1]['code'])
        {
            return;
        }

        $workingString     = $tokens[$stackPointer]['content'];
        $nextTokenPosition = $stackPointer + 1;
        while ($tokens[$nextTokenPosition]['code'] === $tokens[$stackPointer]['code'])
        {
            $workingString .= $tokens[$nextTokenPosition]['content'];
            $nextTokenPosition++;
        }

        // Check if it's a double quoted string.
        // Also make sure it's not a part of a string started in a previous line.
        // If it is, then we have already checked it.
        if (strpos($workingString, '"') === false || $workingString[0] !== '"')
        {
            return;
        }

        // The use of variables in double quoted strings is not allowed.
        if ($tokens[$stackPointer]['code'] === T_DOUBLE_QUOTED_STRING)
        {
            $this->handleDoubleQuotedString($phpcsFile, $stackPointer, $workingString);
        }

        $this->handleSpecialChars($phpcsFile, $stackPointer, $workingString);
    }
43931
protected function addUseStatements(File $phpCsFile, int $stackPointer, array $missingUses): void
    {
        $useStatements = $this->parseUseStatements($phpCsFile, $stackPointer);
        foreach ($missingUses as $missingUse) {
            if (!in_array($missingUse, $useStatements)) {
                $this->addMissingUse($phpCsFile, $stackPointer, $missingUse);
            }
        }
    }
1041172
protected function isSprykerFacadeApiClass(File $phpCsFile, int $stackPointer): bool
    {
        if (!$this->hasNamespace($phpCsFile, $stackPointer)) {
            return false;
        }

        $namespace = $this->getNamespace($phpCsFile, $stackPointer);
        $name = $this->findClassOrInterfaceName($phpCsFile, $stackPointer);
        if (!$name || $name === 'AbstractFacade') {
            return false;
        }

        if (preg_match('/^Spryker\\\\Zed\\\\(.*?)\\\\Business$/', $namespace) && preg_match('/^(.+?)(Facade|FacadeInterface)$/', $name)) {
            return true;
        }

        return false;
    }
613991
protected function assertNewLineAtTheBeginning(File $phpCsFile, int $stackPointer): void
    {
        $tokens = $phpCsFile->getTokens();

        $line = $tokens[$stackPointer]['line'];
        $firstTokenInLineIndex = $stackPointer;
        while ($tokens[$firstTokenInLineIndex - 1]['line'] === $line) {
            $firstTokenInLineIndex--;
        }

        $prevContentIndex = $phpCsFile->findPrevious(T_WHITESPACE, $firstTokenInLineIndex - 1, null, true);
        if ($tokens[$prevContentIndex]['type'] === 'T_DOC_COMMENT_CLOSE_TAG') {
            $firstTokenInLineIndex = $tokens[$prevContentIndex]['comment_opener'];
            while ($tokens[$firstTokenInLineIndex - 1]['line'] === $line) {
                $firstTokenInLineIndex--;
            }
        }

        $prevContentIndex = $phpCsFile->findPrevious(T_WHITESPACE, $firstTokenInLineIndex - 1, null, true);

        // Do not mess with the start of the class
        if ($tokens[$prevContentIndex]['type'] === 'T_OPEN_CURLY_BRACKET') {
            return;
        }

        if ($tokens[$prevContentIndex]['line'] < $tokens[$firstTokenInLineIndex]['line'] - 1) {
            return;
        }

        $fix = $phpCsFile->addFixableError('Every function/method needs a newline before', $firstTokenInLineIndex, 'Concrete');
        if ($fix) {
            $phpCsFile->fixer->addNewline($prevContentIndex);
        }
    }
376380
protected function isFacade(File $phpCsFile, int $stackPointer): bool
    {
        return $this->hasCorrectName($phpCsFile, 'Facade') &&
            $this->extendsAbstract($phpCsFile, $stackPointer, 'AbstractFacade');
    }
149380
protected function addMethodAnnotation(File $phpCsFile, int $stackPointer): void
    {
        $phpCsFile->fixer->beginChangeset();

        $stackPointer = $this->getStackPointerOfClassBegin($phpCsFile, $stackPointer);

        if (!$this->hasDocBlock($phpCsFile, $stackPointer)) {
            $phpCsFile->fixer->addNewlineBefore($stackPointer);
            $phpCsFile->fixer->addContentBefore($stackPointer, ' */');
            $phpCsFile->fixer->addNewlineBefore($stackPointer);
            $phpCsFile->fixer->addContentBefore(
                $stackPointer,
                ' * @method ' . $this->getMethodAnnotationFileName($phpCsFile) . ' ' . $this->getMethodName() . '()'
            );
            $phpCsFile->fixer->addNewlineBefore($stackPointer);
            $phpCsFile->fixer->addContentBefore($stackPointer, '/**');
        } else {
            $position = $phpCsFile->findPrevious(T_DOC_COMMENT_CLOSE_TAG, $stackPointer);
            $phpCsFile->fixer->addNewlineBefore($position);
            $phpCsFile->fixer->addContentBefore(
                $position,
                ' * @method ' . $this->getMethodAnnotationFileName($phpCsFile) . ' ' . $this->getMethodName() . '()'
            );
        }

        $phpCsFile->fixer->endChangeset();
    }
822003
protected function hasNamespace(File $phpCsFile, int $stackPointer): bool
    {
        $namespacePosition = $phpCsFile->findPrevious(T_NAMESPACE, $stackPointer);
        if (!$namespacePosition) {
            return false;
        }

        return true;
    }
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);
    }
1057205
protected function isType(File $phpCsFile, int $stackPointer): bool
    {
        return $this->extendsAbstract($phpCsFile, $stackPointer, 'AbstractType');
    }
1172221
protected function isOwnFileDocBlock(File $phpCsFile, int $stackPointer): bool
    {
        $fileDockBlockTokens = $this->getFileDocBlockTokens($phpCsFile, $stackPointer);

        $firstLineComment = $fileDockBlockTokens[static::FIRST_COMMENT_LINE_POSITION]['content'];

        if (strpos($firstLineComment, 'modified by Spryker Systems GmbH') !== false) {
            return false;
        }

        return true;
    }
110277
protected function isSprykerConstantsInterface(File $phpCsFile, int $stackPointer): bool
    {
        if (!$this->hasNamespace($phpCsFile, $stackPointer)) {
            return false;
        }

        $namespace = $this->getInterfaceNamespace($phpCsFile, $stackPointer);
        if (!preg_match('/^Spryker.*\\\\Shared\\\\/', $namespace)) {
            return false;
        }

        $name = $this->findClassOrInterfaceName($phpCsFile, $stackPointer);
        if (!$name || substr($name, -9) !== 'Constants') {
            return false;
        }

        return true;
    }
1255356
protected function getSnifferIsApplicable(File $phpCsFile, int $stackPointer): bool
    {
        if ($this->isFacade($phpCsFile, $stackPointer)) {
            return true;
        }

        if ($this->isFactory($phpCsFile, $stackPointer)) {
            return true;
        }

        return false;
    }
887752
public function process(File $phpcsFile, $stackPtr)
    {
        if ($this->supportsAbove('7.3') === false) {
            return;
        }

        $funcName = $phpcsFile->getDeclarationName($stackPtr);

        if (strtolower($funcName) !== 'assert') {
            return;
        }

        if ($phpcsFile->hasCondition($stackPtr, $this->scopes) === true) {
            return;
        }

        if ($this->determineNamespace($phpcsFile, $stackPtr) === '') {
            // Not a namespaced function declaration. Parse error, but not our concern.
            return;
        }

        $phpcsFile->addWarning('Declaring a free-standing function called assert() is deprecated since PHP 7.3.', $stackPtr, 'Found');
    }
1027724
public function process(File $phpcsFile, $stackPtr)
    {
        if ($this->supportsAbove('7.2') === false) {
            return;
        }

        $funcName = $phpcsFile->getDeclarationName($stackPtr);

        if (strtolower($funcName) !== '__autoload') {
            return;
        }

        if ($this->validDirectScope($phpcsFile, $stackPtr, $this->checkForScopes) !== false) {
            return;
        }

        if ($this->determineNamespace($phpcsFile, $stackPtr) !== '') {
            return;
        }

        $phpcsFile->addWarning('Use of __autoload() function is deprecated since PHP 7.2', $stackPtr, 'Found');
    }
830176
public function process(File $phpcsFile, $stackPtr)
    {
        parent::process($phpcsFile, $stackPtr);
        $this->processReturnAboveThrows($phpcsFile, $stackPtr);
    }
345623
public function process(File $phpcsFile, $stackPtr)
    {
        $this->checkSpacing($phpcsFile, $stackPtr, true);
        $this->checkSpacing($phpcsFile, $stackPtr, false);
    }
1075397
protected function isPublicMethod(File $phpCsFile, int $stackPointer): bool
    {
        $publicPosition = $phpCsFile->findFirstOnLine(T_PUBLIC, $stackPointer);
        if ($publicPosition) {
            return true;
        }

        return false;
    }