WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
класс не описан

CombinedSelectorNode() WC 1.0

Represents a combined node.

This component is a port of the Python cssselect library, which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.

Хуков нет.

Возвращает

Null. Ничего.

Использование

$CombinedSelectorNode = new CombinedSelectorNode();
// use class methods

Методы

  1. __construct(NodeInterface $selector, $combinator, NodeInterface $subSelector)
  2. __toString()
  3. getCombinator()
  4. getSelector()
  5. getSpecificity()
  6. getSubSelector()

Код CombinedSelectorNode: woocommerce/vendor/symfony/css-selector/Node/CombinedSelectorNode.php WC 4.3.2

<?php
class CombinedSelectorNode extends AbstractNode
{
    private $selector;
    private $combinator;
    private $subSelector;

    /**
     * @param string $combinator
     */
    public function __construct(NodeInterface $selector, $combinator, NodeInterface $subSelector)
    {
        $this->selector = $selector;
        $this->combinator = $combinator;
        $this->subSelector = $subSelector;
    }

    /**
     * @return NodeInterface
     */
    public function getSelector()
    {
        return $this->selector;
    }

    /**
     * @return string
     */
    public function getCombinator()
    {
        return $this->combinator;
    }

    /**
     * @return NodeInterface
     */
    public function getSubSelector()
    {
        return $this->subSelector;
    }

    /**
     * {@inheritdoc}
     */
    public function getSpecificity()
    {
        return $this->selector->getSpecificity()->plus($this->subSelector->getSpecificity());
    }

    /**
     * {@inheritdoc}
     */
    public function __toString()
    {
        $combinator = ' ' === $this->combinator ? '<followed>' : $this->combinator;

        return sprintf('%s[%s %s %s]', $this->getNodeName(), $this->selector, $combinator, $this->subSelector);
    }
}