You are here

public function AttributeNode::__toString in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/css-selector/Node/AttributeNode.php \Symfony\Component\CssSelector\Node\AttributeNode::__toString()

Returns node's string representation.

Return value

string

Overrides NodeInterface::__toString

File

vendor/symfony/css-selector/Node/AttributeNode.php, line 116

Class

AttributeNode
Represents a "<selector>[<namespace>|<attribute> <operator> <value>]" node.

Namespace

Symfony\Component\CssSelector\Node

Code

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);
}