X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=vendor%2Fsymfony%2Fdom-crawler%2FImage.php;fp=vendor%2Fsymfony%2Fdom-crawler%2FImage.php;h=4d6403258057c9dd8fd8ee5ef58ab7ece93a962b;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hp=0000000000000000000000000000000000000000;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad;p=yaffs-website diff --git a/vendor/symfony/dom-crawler/Image.php b/vendor/symfony/dom-crawler/Image.php new file mode 100644 index 000000000..4d6403258 --- /dev/null +++ b/vendor/symfony/dom-crawler/Image.php @@ -0,0 +1,37 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DomCrawler; + +/** + * Image represents an HTML image (an HTML img tag). + */ +class Image extends AbstractUriElement +{ + public function __construct(\DOMElement $node, $currentUri) + { + parent::__construct($node, $currentUri, 'GET'); + } + + protected function getRawUri() + { + return $this->node->getAttribute('src'); + } + + protected function setNode(\DOMElement $node) + { + if ('img' !== $node->nodeName) { + throw new \LogicException(sprintf('Unable to visualize a "%s" tag.', $node->nodeName)); + } + + $this->node = $node; + } +}