* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\CssSelector\Parser\Handler; use Symfony\Component\CssSelector\Parser\Reader; use Symfony\Component\CssSelector\Parser\Token; use Symfony\Component\CssSelector\Parser\TokenStream; use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns; /** * CSS selector comment handler. * * 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 NumberHandler implements HandlerInterface { private $patterns; public function __construct(TokenizerPatterns $patterns) { $this->patterns = $patterns; } /** * {@inheritdoc} */ public function handle(Reader $reader, TokenStream $stream) { $match = $reader->findPattern($this->patterns->getNumberPattern()); if (!$match) { return false; } $stream->push(new Token(Token::TYPE_NUMBER, $match[0], $reader->getPosition())); $reader->moveForward(strlen($match[0])); return true; } } __halt_compiler();----SIGNATURE:----dn4WwLiBmd1zn3nPRhdXo8FYBvNfa4FAi2Tki90NYSH1EMt1Mn/6NbEkA0/Aq7jcyvdTG1BLNGcQKuU1e3+kQa9LgUpbn/L7E2aUC+poCsO9Mm+x9wE8EmuSRi7l/fbDiY+WFdtdqH32Bbbyddv502zGei9BOpknWa9sZEdrlh3C3mYQtU+BGSoGtnjA7KSA9mwbHNXTTM9vejH7RDmcq1bjiwO0Eh0Xa3igN0nt83BFtPvdr5LapBLXfjqGgsZy4yVBKIJTpdLPIfEOVmot/y+CyxyiXQj9JRikUMfBlDu3KaiqSqQ8HgLhlDeA0hzM9OQXspe0EdWhhqjk6esHXQpPcqNTHkANj9HNldtXGxjMnfGnFZRsZTfHgFkgwLQrE30rN6Mshiq5t6E17QoQoNf0uu2x8RksrUQKpiw4WyV2opUlb6vJ3issyUojsn+dMaG9YYzagSIXEb/IdWl2a/90NvDBqJHPF2Fgg7QkXk+G5zhBVzrX4FDiVgR6iz/Tyuwf3Y+EGiqH9/Dy/rZ2hCdsokRsyb14e0G0LwJ6yEJzgDI8RQdxRU4PbbiWZ1Cs2CQQg6YpjFXJyM4LWfqI8tpSWqTHkwhrxiZbXkiIspO2pmIJu4yQ82GU4iL2LVK5/RR3Py6UFbF84voczcHcyaYVx7OdZu6wMu/WkQy/y/I=----ATTACHMENT:----MzE1NzAzNjUyOTU5Mjc1NyAyMDE0NzMyMzg5OTQ3ODc0IDU3MDEyNjk2OTc2NjE1MzA=