Checks the line after the last use and registers an error if needed.

@param int $lastUsePos

@return void
17128
private function checkLinesAfterLastUse(int $lastUsePos): void
    {
        $lastUseEndPos = $this->getLastUseEndPos($lastUsePos);

        list($realLinesAfterUse, $whitespaceEnd) = $this->getRealLinesAfterLastUse($lastUseEndPos);

        $requiredLinesAfter = $this->isEndOfClass($lastUseEndPos)
            ? self::LINES_AFTER_LAST_USE_WHEN_LAST_IN_CLASS
            : self::LINES_AFTER_LAST_USE;

        if ($realLinesAfterUse !== $requiredLinesAfter) {
            $fix = $this->getFile()->addFixableError(
                self::MESSAGE_INCORRECT_LINES_COUNT_AFTER_LAST_USE,
                $lastUsePos,
                self::CODE_INCORRECT_LINES_COUNT_AFTER_LAST_USE,
                [
                    $requiredLinesAfter,
                    $realLinesAfterUse
                ]
            );

            if ($fix) {
                $this->fixLineAfterLastUse($lastUseEndPos, $whitespaceEnd, $requiredLinesAfter);
            }
        }
    }
664343
private function checkAndRegisterLineBreakErrors(): void
    {
        $tokens = $this->getTagTokens();
        $prevToken = [];
        $tagCounts = $this->docTagHelper->getTagCounts($tokens);
        $withReturn = false;

        foreach ($tokens as $tokenPos => $token) {
            $thisTagContent = $token['content'];
            $isReturn = $thisTagContent === '@return';

            $isGroupSwitch =
                // Did we switch the tag ...
                $prevToken && ($prevToken['content'] !== $thisTagContent) &&
                // ... but do we skip singles or are we entering the return block which should contain only 1 tag.
                (($tagCounts[$thisTagContent] !== 1) || ($isReturn && !$withReturn));

            // Insert new line between groups or before the return tag if there is no line break already.
            if ($isGroupSwitch && (($prevToken['line'] + 1) === $token['line'])) {
                $isFixing = $this->file->addFixableWarning(
                    static::MESSAGE_MISSING_NEWLINE_BETWEEN_TAGS,
                    $tokenPos,
                    static::CODE_MISSING_NEWLINE_BETWEEN_TAGS,
                    [
                        $prevToken['content']
                    ]
                );

                if ($isFixing) {
                    $this->insertNewLine($token);
                }
            }

            $prevToken = $token;
            // Return should be the last element, so this is ok.
            $withReturn = $isReturn;
        }
    }
1217833
protected function processLicense($errorPos) {
        $license = $this->commentParser->getLicense();
        if ($license !== null) {
            $value = $license->getValue();
            $comment = $license->getComment();
            if ($value === '' || $comment === '') {
                $error = '@license tag must contain a URL and a license name';
                $this->currentFile->addError($error, $errorPos, 'EmptyLicense');
            }
        }

    }
590871
public function addErrors(ErrorResourceInterface ...$errors): void
    {
        $this->errors = array_merge($this->errors, $errors);
    }
312699
public function getError()
    {
        if (!$this->isDone() || is_null($this->lastProtoResponse->getError())) {
            return null;
        }
        return $this->lastProtoResponse->getError();
    }
638460
protected function processToken(): void
    {
        $this->checkLinesBeforeFirstUse($this->uses[0]);
        $this->checkLinesAfterLastUse($this->uses[count($this->uses) - 1]);

        if (count($this->uses) > 1) {
            $this->checkLinesBetweenUses();
        }
    }
1099848
public function handleDeleteUnusedResources(): void
	{
		if ($this->isAjax()) {
			$this->orm->aclResources->deleteUnused();
			$this->flashNotifier->success('cms.permissions.unusedResourcesDeleted');
		} else {
			$this->terminate();
		}
	}
370328
private function removeOldUseStatements(UseStatement $firstUseStatement): void
    {
        $file = $this->getFile()->getBaseFile();
        $lastUseStatement = end($this->useStatements);
        $lastSemicolonPointer = TokenHelper::findNext($file, T_SEMICOLON, $lastUseStatement->getPointer());

        for ($i = $firstUseStatement->getPointer(); $i <= $lastSemicolonPointer; $i++) {
            $file->fixer->replaceToken($i, '');
        }
    }
770958
public function trackUsedPrefixes( $prefixes )  {
		if ( !is_array( $prefixes ) ) {
			$prefixes = $this->matchPrefixes( $prefixes );
		}

		$this->usedPrefixes = array_merge( $this->usedPrefixes, $prefixes );
	}
883309
final public static function fromLastError()
    {
        $error = error_get_last();
        if ($error !== null) {
            return new ErrorException($error['message'], 0, $error['type'], $error['file'], $error['line']);
        }
    }
1165220
protected function setError($message, array $lastError = null)
    {
        $this->isError = true;
        $this->errMessage = $message;

        if ($lastError !== null) {
            $this->errMessage .= ': ' . $lastError['message'];
            $this->errFile = $lastError['file'];
            $this->errLine = $lastError['line'];
        }
    }
302428
private function fixLineAfterLastUse(
        int $lastUseEndPos,
        int $whitespaceEnd,
        int $requiredLinesAfter
    ): void {
        $file = $this->getFile();

        $file->fixer->beginChangeset();

        for ($i = $lastUseEndPos + 1; $i <= $whitespaceEnd; $i++) {
            $file->fixer->replaceToken($i, '');
        }

        for ($i = 0; $i <= $requiredLinesAfter; $i++) {
            $file->fixer->addNewline($lastUseEndPos);
        }

        $file->fixer->endChangeset();
    }
40305
public function setLastFailureTime($service, $lastFailureTime)
    {
        $this->adapter->saveLastFailureTime($this->lastFailureKey($service), $lastFailureTime);
    }
935781
protected function checkUseStatement(File $phpcsFile, array $useStatement, string $applicationLayer): void
    {
        $className = $useStatement['fullName'];

        $pairsToCheck = static::INVALID_PAIRS;
        foreach ($pairsToCheck as $pair) {
            if ($pair['from'] !== $applicationLayer) {
                continue;
            }

            if (!preg_match('#^\w+\\\\' . $pair['to'] . '\\\\#', $className, $matches)) {
                continue;
            }

            $phpcsFile->addError(
                sprintf(
                    'No %s namespace allowed in %s files.',
                    $pair['to'],
                    $pair['from']
                ),
                $useStatement['start'],
                'InvalidCrossNamespace'
            );
        }
    }
1365391
public function validateLineEndings($originFile)
	{
		$fileContents = (string) file_get_contents($this->originPath . '/' . $originFile);

		if (strpos($fileContents, "\r") !== false)
		{
			$this->output->addMessage(Output::FATAL, 'Not using Linux line endings (LF)', $originFile);
		}
	}
371999
public function closeRow($last = false)
	{
		$this->_strategy->output($this->endRow() . ($last ? '' : $this->rowSeparator()));
	}
947235
protected function insertUseStatement(File $phpcsFile, array $useStatement): void
    {
        $existingStatements = $this->existingStatements;
        if ($existingStatements) {
            $lastOne = array_pop($existingStatements);

            $lastUseStatementIndex = $lastOne['end'];
        } else {
            $namespaceStatement = $this->getNamespaceStatement($phpcsFile);

            $lastUseStatementIndex = $namespaceStatement['end'];
        }

        $phpcsFile->fixer->addNewline($lastUseStatementIndex);
        $phpcsFile->fixer->addContent($lastUseStatementIndex, $this->generateUseStatement($useStatement));
    }