Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. SyntaxErrorException.php

class 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

  • class \Symfony\Component\CssSelector\Exception\ParseException extends \Symfony\Component\CssSelector\Exception\Exception implements \Symfony\Component\CssSelector\Exception\ExceptionInterface
    • class \Symfony\Component\CssSelector\Exception\SyntaxErrorException extends \Symfony\Component\CssSelector\Exception\ParseException

Expanded class hierarchy of SyntaxErrorException

See also

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

4 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
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 {
    public static function unexpectedToken(string $expectedValue, Token $foundToken) : self {
        return new self(\sprintf('Expected %s, but %s found.', $expectedValue, $foundToken));
    }
    public static function pseudoElementFound(string $pseudoElement, string $unexpectedLocation) : self {
        return new self(\sprintf('Unexpected pseudo-element "::%s" found %s.', $pseudoElement, $unexpectedLocation));
    }
    public static function unclosedString(int $position) : self {
        return new self(\sprintf('Unclosed/invalid string at %s.', $position));
    }
    public static function nestedNot() : self {
        return new self('Got nested ::not().');
    }
    public static function notAtTheStartOfASelector(string $pseudoElement) : self {
        return new self(\sprintf('Got immediate child pseudo-element ":%s" not at the start of a selector', $pseudoElement));
    }
    public static function stringAsFunctionArgument() : self {
        return new self('String not allowed as function argument.');
    }

}

Members

Title Sort descending Modifiers Object type Summary
SyntaxErrorException::nestedNot public static function
SyntaxErrorException::notAtTheStartOfASelector public static function
SyntaxErrorException::pseudoElementFound public static function
SyntaxErrorException::stringAsFunctionArgument public static function
SyntaxErrorException::unclosedString public static function
SyntaxErrorException::unexpectedToken public static function

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal