* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\CssSelector\Node; /** * Represents a "[| ]" node. * * This component is a port of the Python cssselect library, * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon * * @internal */ class AttributeNode extends AbstractNode { private $selector; private $namespace; private $attribute; private $operator; private $value; /** * @param NodeInterface $selector * @param string $namespace * @param string $attribute * @param string $operator * @param string $value */ public function __construct(NodeInterface $selector, $namespace, $attribute, $operator, $value) { $this->selector = $selector; $this->namespace = $namespace; $this->attribute = $attribute; $this->operator = $operator; $this->value = $value; } /** * @return NodeInterface */ public function getSelector() { return $this->selector; } /** * @return string */ public function getNamespace() { return $this->namespace; } /** * @return string */ public function getAttribute() { return $this->attribute; } /** * @return string */ public function getOperator() { return $this->operator; } /** * @return string */ public function getValue() { return $this->value; } /** * {@inheritdoc} */ public function getSpecificity() { return $this->selector->getSpecificity()->plus(new Specificity(0, 1, 0)); } /** * {@inheritdoc} */ public function __toString() { $attribute = $this->namespace ? $this->namespace.'|'.$this->attribute : $this->attribute; return 'exists' === $this->operator ? sprintf('%s[%s[%s]]', $this->getNodeName(), $this->selector, $attribute) : sprintf("%s[%s[%s %s '%s']]", $this->getNodeName(), $this->selector, $attribute, $this->operator, $this->value); } } __halt_compiler();----SIGNATURE:----t2NUIC39kLRu22aOfENOPZpMSzj+Uk2O9COooOIz824qW2AcUdFRWvAumd/dG38OfxqaI1LWOgv4kD5vYKBLoKrb48Xdy+KRHqu2NXofoUt/quCBZWDuQVcfUMojQDNl/7c6QR11hTgxTP0RFUr305OlZQryiYSreOKX04U2088nGTqMusP6tDQDTPbQbWB9R8CwBEfHgL25NMsBCyF519A19gatIZbBOkCkkGbky2AbAbTz3iVk5VlMSt7g475sgJ0UdybNb6CAHK6dlDJHkpf6Eqm32EdOudvm44Hg/kpsq2ZyALAC0x+LpJ3hKzlcXq/VQBeiXGp5SBGY4j63/OHdtjSvmvZKvBtjK+FmnA46cRxIbN5lAH45AAj6VRjeGALiZpuMQN7357IuGmBBDXLsDYYQue0zYHBE8kgCB0FFI8SejbeTnvtrovS7v8jUefCO0RZ+yK7FjMp7JMecSQMKTLqW2PiTF1isBfuiQxJTxA3VaB916FyLflNFZWiN+mZCExlBrY0c+5hMS+J3sEh5rn0zCBdt06wz8ZuArIzaWeB4JzghafKOBu1+pu0c1wuwdzfVkA2Zg4NYgVenPku+sQT6i08Ml1YVyIy3qj+FFU0EXXQmUvVR28az9Kn2VQv3/kVFpqUXjLxUvW7SjkWAdztTqFOSYPxUHusKChA=----ATTACHMENT:----MTk1MjA5NzY1Mzg5Njg2IDgxODA4MTQ3NjQ0NjgzMTkgODcxNjkwOTE0MDcxNjI=