You are here

class SyntaxErrorException in Zircon Profile 8

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

ParseException is thrown when a CSS selector syntax is not valid.

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 SyntaxErrorException

See also

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

5 files declare their use of SyntaxErrorException
FunctionExtension.php in vendor/symfony/css-selector/XPath/Extension/FunctionExtension.php
Parser.php in vendor/symfony/css-selector/Parser/Parser.php
ParserTest.php in vendor/symfony/css-selector/Tests/Parser/ParserTest.php
StringHandler.php in vendor/symfony/css-selector/Parser/Handler/StringHandler.php
TokenStream.php in vendor/symfony/css-selector/Parser/TokenStream.php

File

vendor/symfony/css-selector/Exception/SyntaxErrorException.php, line 24

Namespace

Symfony\Component\CssSelector\Exception
View source
class SyntaxErrorException extends ParseException {

  /**
   * @param string $expectedValue
   * @param Token  $foundToken
   *
   * @return SyntaxErrorException
   */
  public static function unexpectedToken($expectedValue, Token $foundToken) {
    return new self(sprintf('Expected %s, but %s found.', $expectedValue, $foundToken));
  }

  /**
   * @param string $pseudoElement
   * @param string $unexpectedLocation
   *
   * @return SyntaxErrorException
   */
  public static function pseudoElementFound($pseudoElement, $unexpectedLocation) {
    return new self(sprintf('Unexpected pseudo-element "::%s" found %s.', $pseudoElement, $unexpectedLocation));
  }

  /**
   * @param int $position
   *
   * @return SyntaxErrorException
   */
  public static function unclosedString($position) {
    return new self(sprintf('Unclosed/invalid string at %s.', $position));
  }

  /**
   * @return SyntaxErrorException
   */
  public static function nestedNot() {
    return new self('Got nested ::not().');
  }

  /**
   * @return SyntaxErrorException
   */
  public static function stringAsFunctionArgument() {
    return new self('String not allowed as function argument.');
  }

}

Members