original_string: public function image()
      {
          if (!\count($this)) {
              throw new \InvalidArgumentException('The current node list is empty.');
          }
  
          $node = $this->getNode(0);
  
          if (!$node instanceof \DOMElement) {
              throw new \InvalidArgumentException(sprintf('The selected node should be instance of DOMElement, got "%s".', \get_class($node)));
          }
  
          return new Image($node, $this->baseHref);
      }
code: public function image()
      {
          if (!\count($this)) {
              throw new \InvalidArgumentException('The current node list is empty.');
          }
  
          $node = $this->getNode(0);
  
          if (!$node instanceof \DOMElement) {
              throw new \InvalidArgumentException(sprintf('The selected node should be instance of DOMElement, got "%s".', \get_class($node)));
          }
  
          return new Image($node, $this->baseHref);
      }
code_tokens: public function image ( ) { if ( ! \ count ( $ this ) ) { throw new \ InvalidArgumentException ( 'The current node list is empty.' ) ; } $ node = $ this -> getNode ( 0 ) ; if ( ! $ node instanceof \ DOMElement ) { throw new \ InvalidArgumentException ( sprintf ( 'The selected node should be instance of DOMElement, got "%s".' , \ get_class ( $ node ) ) ) ; } return new Image ( $ node , $ this -> baseHref ) ; }
docstring: Returns an Image object for the first node in the list.
  
  @return Image An Image instance
  
  @throws \InvalidArgumentException If the current node list is empty
docstring_tokens: Returns an Image object for the first node in the list .