You are here

class CommentHandler in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/css-selector/Parser/Handler/CommentHandler.php \Symfony\Component\CssSelector\Parser\Handler\CommentHandler

CSS selector comment handler.

This component is a port of the Python cssselect library, which is copyright Ian Bicking, @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>

Hierarchy

Expanded class hierarchy of CommentHandler

See also

https://github.com/SimonSapin/cssselect.

1 file declares its use of CommentHandler
CommentHandlerTest.php in vendor/symfony/css-selector/Tests/Parser/Handler/CommentHandlerTest.php

File

vendor/symfony/css-selector/Parser/Handler/CommentHandler.php, line 25

Namespace

Symfony\Component\CssSelector\Parser\Handler
View source
class CommentHandler implements HandlerInterface {

  /**
   * {@inheritdoc}
   */
  public function handle(Reader $reader, TokenStream $stream) {
    if ('/*' !== $reader
      ->getSubstring(2)) {
      return false;
    }
    $offset = $reader
      ->getOffset('*/');
    if (false === $offset) {
      $reader
        ->moveToEnd();
    }
    else {
      $reader
        ->moveForward($offset + 2);
    }
    return true;
  }

}

Members