protected function getTrailingCommentOrSelf(File $phpcsFile, $stackPtr)
    {
        $nextTokens = array($stackPtr);
        $tokens = $phpcsFile->getTokens();

        do {
            $next    = end($nextTokens);
            $newNext = $phpcsFile->findNext(
                T_WHITESPACE,
                ($next + 1),
                null,
                true
            );

            if ($tokens[$newNext]['code'] === T_COMMENT
                && $tokens[$newNext]['line'] === ($tokens[$next]['line'] + 1)
            ) {
                $nextTokens[] = $newNext;
            } else {
                break;
            }
        } while (true);

        return end($nextTokens);
    }