code: private function isCommentLastLineToken(Tokens $tokens, $index)
      {
          if (!$tokens[$index]->isComment() || !$tokens[$index + 1]->isWhitespace()) {
              return false;
          }
  
          $content = $tokens[$index + 1]->getContent();
  
          return $content !== ltrim($content, "\r\n");
      }
docs: Check if last item of current line is a comment.
  
  @param Tokens $tokens tokens to handle
  @param int    $index  index of token
  
  @return bool