275 lines
6.8 KiB
YAML
275 lines
6.8 KiB
YAML
|
name: Parser
|
||
|
class_comment: '# * Parser parses YAML strings to convert them to PHP arrays.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @author Fabien Potencier <fabien@symfony.com>
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @final'
|
||
|
dependencies:
|
||
|
- name: ParseException
|
||
|
type: class
|
||
|
source: Symfony\Component\Yaml\Exception\ParseException
|
||
|
- name: TaggedValue
|
||
|
type: class
|
||
|
source: Symfony\Component\Yaml\Tag\TaggedValue
|
||
|
properties: []
|
||
|
methods:
|
||
|
- name: parseFile
|
||
|
visibility: public
|
||
|
parameters:
|
||
|
- name: filename
|
||
|
- name: flags
|
||
|
default: '0'
|
||
|
comment: "# * Parser parses YAML strings to convert them to PHP arrays.\n# *\n#\
|
||
|
\ * @author Fabien Potencier <fabien@symfony.com>\n# *\n# * @final\n# */\n# class\
|
||
|
\ Parser\n# {\n# public const TAG_PATTERN = '(?P<tag>![\\w!.\\/:-]+)';\n# public\
|
||
|
\ const BLOCK_SCALAR_HEADER_PATTERN = '(?P<separator>\\||>)(?P<modifiers>\\+|\\\
|
||
|
-|\\d+|\\+\\d+|\\-\\d+|\\d+\\+|\\d+\\-)?(?P<comments> +#.*)?';\n# public const\
|
||
|
\ REFERENCE_PATTERN = '#^&(?P<ref>[^ ]++) *+(?P<value>.*)#u';\n# \n# private ?string\
|
||
|
\ $filename = null;\n# private int $offset = 0;\n# private int $numberOfParsedLines\
|
||
|
\ = 0;\n# private ?int $totalNumberOfLines = null;\n# private array $lines = [];\n\
|
||
|
# private int $currentLineNb = -1;\n# private string $currentLine = '';\n# private\
|
||
|
\ array $refs = [];\n# private array $skippedLineNumbers = [];\n# private array\
|
||
|
\ $locallySkippedLineNumbers = [];\n# private array $refsBeingParsed = [];\n#\
|
||
|
\ \n# /**\n# * Parses a YAML file into a PHP value.\n# *\n# * @param string \
|
||
|
\ $filename The path to the YAML file to be parsed\n# * @param\
|
||
|
\ int-mask-of<Yaml::PARSE_*> $flags A bit field of Yaml::PARSE_* constants\
|
||
|
\ to customize the YAML parser behavior\n# *\n# * @throws ParseException If the\
|
||
|
\ file could not be read or the YAML is not valid"
|
||
|
- name: parse
|
||
|
visibility: public
|
||
|
parameters:
|
||
|
- name: value
|
||
|
- name: flags
|
||
|
default: '0'
|
||
|
comment: '# * Parses a YAML string to a PHP value.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @param string $value A YAML string
|
||
|
|
||
|
# * @param int-mask-of<Yaml::PARSE_*> $flags A bit field of Yaml::PARSE_* constants
|
||
|
to customize the YAML parser behavior
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @throws ParseException If the YAML is not valid'
|
||
|
- name: doParse
|
||
|
visibility: private
|
||
|
parameters:
|
||
|
- name: value
|
||
|
- name: flags
|
||
|
comment: null
|
||
|
- name: parseBlock
|
||
|
visibility: private
|
||
|
parameters:
|
||
|
- name: offset
|
||
|
- name: yaml
|
||
|
- name: flags
|
||
|
comment: null
|
||
|
- name: getRealCurrentLineNb
|
||
|
visibility: public
|
||
|
parameters: []
|
||
|
comment: '# * Returns the current line number (takes the offset into account).
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @internal'
|
||
|
- name: getCurrentLineIndentation
|
||
|
visibility: private
|
||
|
parameters: []
|
||
|
comment: null
|
||
|
- name: getNextEmbedBlock
|
||
|
visibility: private
|
||
|
parameters:
|
||
|
- name: indentation
|
||
|
default: 'null'
|
||
|
- name: inSequence
|
||
|
default: 'false'
|
||
|
comment: '# * Returns the next embed block of YAML.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @param int|null $indentation The indent level at which the block is to be
|
||
|
read, or null for default
|
||
|
|
||
|
# * @param bool $inSequence True if the enclosing data structure is a sequence
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @throws ParseException When indentation problem are detected'
|
||
|
- name: hasMoreLines
|
||
|
visibility: private
|
||
|
parameters: []
|
||
|
comment: null
|
||
|
- name: moveToNextLine
|
||
|
visibility: private
|
||
|
parameters: []
|
||
|
comment: '# * Moves the parser to the next line.'
|
||
|
- name: moveToPreviousLine
|
||
|
visibility: private
|
||
|
parameters: []
|
||
|
comment: '# * Moves the parser to the previous line.'
|
||
|
- name: parseValue
|
||
|
visibility: private
|
||
|
parameters:
|
||
|
- name: value
|
||
|
- name: flags
|
||
|
- name: context
|
||
|
comment: '# * Parses a YAML value.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @param string $value A YAML value
|
||
|
|
||
|
# * @param int $flags A bit field of Yaml::PARSE_* constants to customize
|
||
|
the YAML parser behavior
|
||
|
|
||
|
# * @param string $context The parser context (either sequence or mapping)
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @throws ParseException When reference does not exist'
|
||
|
- name: parseBlockScalar
|
||
|
visibility: private
|
||
|
parameters:
|
||
|
- name: style
|
||
|
- name: chomping
|
||
|
default: ''''''
|
||
|
- name: indentation
|
||
|
default: '0'
|
||
|
comment: '# * Parses a block scalar.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @param string $style The style indicator that was used to begin this
|
||
|
block scalar (| or >)
|
||
|
|
||
|
# * @param string $chomping The chomping indicator that was used to begin this
|
||
|
block scalar (+ or -)
|
||
|
|
||
|
# * @param int $indentation The indentation indicator that was used to begin
|
||
|
this block scalar'
|
||
|
- name: isNextLineIndented
|
||
|
visibility: private
|
||
|
parameters: []
|
||
|
comment: '# * Returns true if the next line is indented.'
|
||
|
- name: isCurrentLineEmpty
|
||
|
visibility: private
|
||
|
parameters: []
|
||
|
comment: null
|
||
|
- name: isCurrentLineBlank
|
||
|
visibility: private
|
||
|
parameters: []
|
||
|
comment: null
|
||
|
- name: isCurrentLineComment
|
||
|
visibility: private
|
||
|
parameters: []
|
||
|
comment: null
|
||
|
- name: isCurrentLineLastLineInDocument
|
||
|
visibility: private
|
||
|
parameters: []
|
||
|
comment: null
|
||
|
- name: cleanup
|
||
|
visibility: private
|
||
|
parameters:
|
||
|
- name: value
|
||
|
comment: null
|
||
|
- name: isNextLineUnIndentedCollection
|
||
|
visibility: private
|
||
|
parameters: []
|
||
|
comment: null
|
||
|
- name: isStringUnIndentedCollectionItem
|
||
|
visibility: private
|
||
|
parameters: []
|
||
|
comment: null
|
||
|
- name: preg_match
|
||
|
visibility: public
|
||
|
parameters:
|
||
|
- name: pattern
|
||
|
- name: subject
|
||
|
- name: '&$matches'
|
||
|
default: 'null'
|
||
|
- name: flags
|
||
|
default: '0'
|
||
|
- name: offset
|
||
|
default: '0'
|
||
|
comment: '# * 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
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @throws ParseException on a PCRE internal error
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @internal'
|
||
|
- name: trimTag
|
||
|
visibility: private
|
||
|
parameters:
|
||
|
- name: value
|
||
|
comment: '# * Trim the tag on top of the value.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * Prevent values such as "!foo {quz: bar}" to be considered as
|
||
|
|
||
|
# * a mapping block.'
|
||
|
- name: getLineTag
|
||
|
visibility: private
|
||
|
parameters:
|
||
|
- name: value
|
||
|
- name: flags
|
||
|
- name: nextLineCheck
|
||
|
default: 'true'
|
||
|
comment: null
|
||
|
- name: lexInlineQuotedString
|
||
|
visibility: private
|
||
|
parameters:
|
||
|
- name: '&$cursor'
|
||
|
default: '0'
|
||
|
comment: null
|
||
|
- name: lexUnquotedString
|
||
|
visibility: private
|
||
|
parameters:
|
||
|
- name: '&$cursor'
|
||
|
comment: null
|
||
|
- name: lexInlineMapping
|
||
|
visibility: private
|
||
|
parameters:
|
||
|
- name: '&$cursor'
|
||
|
default: '0'
|
||
|
comment: null
|
||
|
- name: lexInlineSequence
|
||
|
visibility: private
|
||
|
parameters:
|
||
|
- name: '&$cursor'
|
||
|
default: '0'
|
||
|
comment: null
|
||
|
- name: lexInlineStructure
|
||
|
visibility: private
|
||
|
parameters:
|
||
|
- name: '&$cursor'
|
||
|
- name: closingTag
|
||
|
comment: null
|
||
|
- name: consumeWhitespaces
|
||
|
visibility: private
|
||
|
parameters:
|
||
|
- name: '&$cursor'
|
||
|
comment: null
|
||
|
traits:
|
||
|
- Symfony\Component\Yaml\Exception\ParseException
|
||
|
- Symfony\Component\Yaml\Tag\TaggedValue
|
||
|
interfaces: []
|