|
| static | preg_match (string $pattern, string $subject, ?array &$matches=null, int $flags=0, int $offset=0) |
|
|
const | TAG_PATTERN = '(?P<tag>![\w!.\/:-]+)' |
|
const | BLOCK_SCALAR_HEADER_PATTERN = '(?P<separator>\||>)(?P<modifiers>\+|\-|\d+|\+\d+|\-\d+|\d+\+|\d+\-)?(?P<comments> +#.*)?' |
|
const | REFERENCE_PATTERN = '#^&(?P<ref>[^ ]++) *+(?P<value>.*)#u' |
Parser parses YAML strings to convert them to PHP arrays.
- Auteur
- Fabien Potencier fabie.nosp@m.n@sy.nosp@m.mfony.nosp@m..com
@final
◆ getRealCurrentLineNb()
Returns the current line number (takes the offset into account).
◆ parse()
| parse |
( |
string | $value, |
|
|
int | $flags = 0 ) |
Parses a YAML string to a PHP value.
- Paramètres
-
| string | $value | A YAML string |
| int-mask-of<Yaml::PARSE_*> | $flags A bit field of Yaml::PARSE_* constants to customize the YAML parser behavior |
- Exceptions
-
| ParseException | If the YAML is not valid |
| SyntaxError | |
◆ parseFile()
| parseFile |
( |
string | $filename, |
|
|
int | $flags = 0 ) |
Parses a YAML file into a PHP value.
- Paramètres
-
| string | $filename | The path to the YAML file to be parsed |
| int-mask-of<Yaml::PARSE_*> | $flags A bit field of Yaml::PARSE_* constants to customize the YAML parser behavior |
- Exceptions
-
| ParseException | If the file could not be read or the YAML is not valid |
◆ preg_match()
| preg_match |
( |
string | $pattern, |
|
|
string | $subject, |
|
|
?array & | $matches = null, |
|
|
int | $flags = 0, |
|
|
int | $offset = 0 ) |
|
static |
A local wrapper for "preg_match" which will throw a ParseException if there is an internal error in the PCRE engine.
This avoids us needing to check for "false" every time PCRE is used in the YAML engine
- Exceptions
-
| ParseException | on a PCRE internal error |
La documentation de cette classe a été générée à partir des fichiers suivants :
- vendor/symfony/yaml/Parser.php
- vendor/twig/twig/src/Parser.php