PHP 8.3.31
Preview: MatchingNode.php Size: 1.45 KB
/home/getspomw/royalsquad.us/vendor/symfony/css-selector/Node/MatchingNode.php

<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * 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 "<selector>:is(<subSelectorList>)" node.
 *
 * This component is a port of the Python cssselect library,
 * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
 *
 * @author Hubert Lenoir <lenoir.hubert@gmail.com>
 *
 * @internal
 */
class MatchingNode extends AbstractNode
{
    /**
     * @param array<NodeInterface> $arguments
     */
    public function __construct(
        public readonly NodeInterface $selector,
        public readonly array $arguments = [],
    ) {
    }

    public function getSpecificity(): Specificity
    {
        $argumentsSpecificity = array_reduce(
            $this->arguments,
            fn ($c, $n) => 1 === $n->getSpecificity()->compareTo($c) ? $n->getSpecificity() : $c,
            new Specificity(0, 0, 0),
        );

        return $this->selector->getSpecificity()->plus($argumentsSpecificity);
    }

    public function __toString(): string
    {
        $selectorArguments = array_map(
            fn ($n): string => ltrim((string) $n, '*'),
            $this->arguments,
        );

        return \sprintf('%s[%s:is(%s)]', $this->getNodeName(), $this->selector, implode(', ', $selectorArguments));
    }
}

Directory Contents

Dirs: 0 × Files: 15

Name Size Perms Modified Actions
793 B lrw-rw-rw- 2025-09-17 06:53:17
Edit Download
1.83 KB lrw-rw-rw- 2025-09-17 06:53:17
Edit Download
1.16 KB lrw-rw-rw- 2025-09-17 06:53:17
Edit Download
1.44 KB lrw-rw-rw- 2025-09-17 06:53:17
Edit Download
1.23 KB lrw-rw-rw- 2025-09-17 06:53:17
Edit Download
12.26 KB lrw-r--r-- 2026-04-27 10:18:33
Edit Download
1.65 KB lrw-rw-rw- 2025-09-17 06:53:17
Edit Download
1.15 KB lrw-rw-rw- 2025-09-17 06:53:17
Edit Download
1.45 KB lrw-rw-rw- 2025-09-17 06:53:17
Edit Download
1.23 KB lrw-rw-rw- 2025-09-17 06:53:17
Edit Download
692 B lrw-rw-rw- 2025-09-17 06:53:17
Edit Download
1.27 KB lrw-rw-rw- 2025-09-17 06:53:17
Edit Download
1.37 KB lrw-rw-rw- 2025-09-17 06:53:17
Edit Download
1.70 KB lrw-rw-rw- 2025-09-17 06:53:17
Edit Download
1.22 KB lrw-rw-rw- 2025-09-17 06:53:17
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).