private function searchEmptyLines(File $phpcsFile, int $searchPosition): void
    {
        $endOfDoc = $phpcsFile->findEndOfStatement($searchPosition);

        do {
            $currentToken = $phpcsFile->getTokens()[$searchPosition];
            $nextTokenPosition = (int) $phpcsFile->findNext(
                [T_DOC_COMMENT_WHITESPACE, T_DOC_COMMENT_STAR],
                $searchPosition + 1,
                $endOfDoc,
                true
            );

            if ($hasToken = ($nextTokenPosition > 0)) {
                $nextToken = $phpcsFile->getTokens()[$nextTokenPosition];
                $hasTooManyLines = ($nextToken['line'] - $currentToken['line']) > 2;

                if ($hasTooManyLines) {
                    $isFixing = $phpcsFile->addFixableError(
                        self::ERROR_EMPTY_LINES_FOUND,
                        $nextTokenPosition,
                        static::CODE_EMPTY_LINES_FOUND
                    );

                    if ($isFixing) {
                        $this->removeUnnecessaryLines($phpcsFile, $nextToken, $currentToken);
                    }
                }

                $phpcsFile->recordMetric(
                    $searchPosition,
                    'DocBlock has too many lines',
                    $hasTooManyLines ? 'yes' : 'no'
                );

                $searchPosition = $nextTokenPosition;
            }
        } while ($hasToken);
    }