WordPress at a glance
class is not described

Symfony\Component\CssSelector\Parser\Handler

WhitespaceHandler{} WC 1.0

CSS selector whitespace handler.

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

No Hooks.

Return

null. Nothing.

Usage

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

Methods

  1. handle(Reader $reader, TokenStream $stream)

Code of WhitespaceHandler{} WC 5.3.0

<?php
class WhitespaceHandler implements HandlerInterface
{
    /**
     * {@inheritdoc}
     */
    public function handle(Reader $reader, TokenStream $stream)
    {
        $match = $reader->findPattern('~^[ \t\r\n\f]+~');

        if (false === $match) {
            return false;
        }

        $stream->push(new Token(Token::TYPE_WHITESPACE, $match[0], $reader->getPosition()));
        $reader->moveForward(strlen($match[0]));

        return true;
    }
}