Chris@0: Chris@0: * Chris@0: * For the full copyright and license information, please view the LICENSE Chris@0: * file that was distributed with this source code. Chris@0: */ Chris@0: Chris@0: namespace Symfony\Component\DomCrawler; Chris@0: Chris@0: /** Chris@0: * Link represents an HTML link (an HTML a, area or link tag). Chris@0: * Chris@0: * @author Fabien Potencier Chris@0: */ Chris@0: class Link extends AbstractUriElement Chris@0: { Chris@0: protected function getRawUri() Chris@0: { Chris@0: return $this->node->getAttribute('href'); Chris@0: } Chris@0: Chris@0: protected function setNode(\DOMElement $node) Chris@0: { Chris@0: if ('a' !== $node->nodeName && 'area' !== $node->nodeName && 'link' !== $node->nodeName) { Chris@0: throw new \LogicException(sprintf('Unable to navigate from a "%s" tag.', $node->nodeName)); Chris@0: } Chris@0: Chris@0: $this->node = $node; Chris@0: } Chris@0: }