You are here

public function NumberHandler::handle in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/css-selector/Parser/Handler/NumberHandler.php \Symfony\Component\CssSelector\Parser\Handler\NumberHandler::handle()

Parameters

Reader $reader:

TokenStream $stream:

Return value

bool

Overrides HandlerInterface::handle

File

vendor/symfony/css-selector/Parser/Handler/NumberHandler.php, line 45

Class

NumberHandler
CSS selector comment handler.

Namespace

Symfony\Component\CssSelector\Parser\Handler

Code

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