class EmptyStringParser in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/css-selector/Parser/Shortcut/EmptyStringParser.php \Symfony\Component\CssSelector\Parser\Shortcut\EmptyStringParser
CSS selector class parser shortcut.
This shortcut ensure compatibility with previous version.
- The parser fails to parse an empty string.
- In the previous version, an empty string matches each tags.
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\Parser\Shortcut\EmptyStringParser implements ParserInterface
Expanded class hierarchy of EmptyStringParser
See also
https://github.com/SimonSapin/cssselect.
2 files declare their use of EmptyStringParser
- CssSelector.php in vendor/
symfony/ css-selector/ CssSelector.php - EmptyStringParserTest.php in vendor/
symfony/ css-selector/ Tests/ Parser/ Shortcut/ EmptyStringParserTest.php
File
- vendor/
symfony/ css-selector/ Parser/ Shortcut/ EmptyStringParser.php, line 30
Namespace
Symfony\Component\CssSelector\Parser\ShortcutView source
class EmptyStringParser implements ParserInterface {
/**
* {@inheritdoc}
*/
public function parse($source) {
// Matches an empty string
if ($source == '') {
return array(
new SelectorNode(new ElementNode(null, '*')),
);
}
return array();
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
EmptyStringParser:: |
public | function |
Parses given selector source into an array of tokens. Overrides ParserInterface:: |