PhpCsFixer\Fixer\FunctionNotation\MethodArgumentSpaceFixer::isCommentLastLineToken PHP Method

isCommentLastLineToken() private method

Check if last item of current line is a comment.
private isCommentLastLineToken ( Tokens $tokens, integer $index ) : boolean
$tokens PhpCsFixer\Tokenizer\Tokens tokens to handle
$index integer index of token
return boolean
    private function isCommentLastLineToken(Tokens $tokens, $index)
    {
        if (!$tokens[$index]->isComment()) {
            return false;
        }
        $nextToken = $tokens[$index + 1];
        if (!$nextToken->isWhitespace()) {
            return false;
        }
        $content = $nextToken->getContent();
        return $content !== ltrim($content, "\r\n");
    }