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

ClassNode() WC 1.0

Represents a "<selector>.<name>" node.

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

Хуков нет.

Возвращает

Null. Ничего.

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

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

Методы

  1. __construct(NodeInterface $selector, $name)
  2. __toString()
  3. getName()
  4. getSelector()
  5. getSpecificity()

Код ClassNode: woocommerce/vendor/symfony/css-selector/Node/ClassNode.php WC 4.3.1

<?php
class ClassNode extends AbstractNode
{
    private $selector;
    private $name;

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

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

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

    /**
     * {@inheritdoc}
     */
    public function getSpecificity()
    {
        return $this->selector->getSpecificity()->plus(new Specificity(0, 1, 0));
    }

    /**
     * {@inheritdoc}
     */
    public function __toString()
    {
        return sprintf('%s[%s.%s]', $this->getNodeName(), $this->selector, $this->name);
    }
}