CommentHandler.php
2 years ago
HandlerInterface.php
2 years ago
HashHandler.php
2 years ago
IdentifierHandler.php
2 years ago
NumberHandler.php
2 years ago
StringHandler.php
2 years ago
WhitespaceHandler.php
2 years ago
index.php
2 years ago
WhitespaceHandler.php
20 lines
| 1 | <?php |
| 2 | namespace MailPoetVendor\Symfony\Component\CssSelector\Parser\Handler; |
| 3 | if (!defined('ABSPATH')) exit; |
| 4 | use MailPoetVendor\Symfony\Component\CssSelector\Parser\Reader; |
| 5 | use MailPoetVendor\Symfony\Component\CssSelector\Parser\Token; |
| 6 | use MailPoetVendor\Symfony\Component\CssSelector\Parser\TokenStream; |
| 7 | class WhitespaceHandler implements HandlerInterface |
| 8 | { |
| 9 | public function handle(Reader $reader, TokenStream $stream) : bool |
| 10 | { |
| 11 | $match = $reader->findPattern('~^[ \\t\\r\\n\\f]+~'); |
| 12 | if (\false === $match) { |
| 13 | return \false; |
| 14 | } |
| 15 | $stream->push(new Token(Token::TYPE_WHITESPACE, $match[0], $reader->getPosition())); |
| 16 | $reader->moveForward(\strlen($match[0])); |
| 17 | return \true; |
| 18 | } |
| 19 | } |
| 20 |