4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\DomCrawler;
15 * Image represents an HTML image (an HTML img tag).
17 class Image extends AbstractUriElement
19 public function __construct(\DOMElement $node, $currentUri)
21 parent::__construct($node, $currentUri, 'GET');
24 protected function getRawUri()
26 return $this->node->getAttribute('src');
29 protected function setNode(\DOMElement $node)
31 if ('img' !== $node->nodeName) {
32 throw new \LogicException(sprintf('Unable to visualize a "%s" tag.', $node->nodeName));