public image ( ) : Symfony\Component\DomCrawler\Image | ||
return | Symfony\Component\DomCrawler\Image | An Image instance |
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);
}