Jobbuddy
Chargement...
Recherche...
Aucune correspondance
Référence de la classe Parser

Fonctions membres publiques

 parseFile (string $filename, int $flags=0)
 parse (string $value, int $flags=0)
 getRealCurrentLineNb ()

Fonctions membres publiques statiques

static preg_match (string $pattern, string $subject, ?array &$matches=null, int $flags=0, int $offset=0)

Champs de données

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'

Description détaillée

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

Documentation des fonctions membres

◆ getRealCurrentLineNb()

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$valueA YAML string
int-mask-of<Yaml::PARSE_*>$flags A bit field of Yaml::PARSE_* constants to customize the YAML parser behavior
Exceptions
ParseExceptionIf the YAML is not valid
SyntaxError

◆ parseFile()

parseFile ( string $filename,
int $flags = 0 )

Parses a YAML file into a PHP value.

Paramètres
string$filenameThe 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
ParseExceptionIf 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
ParseExceptionon a PCRE internal error

La documentation de cette classe a été générée à partir des fichiers suivants :