Lines Matching refs:flags

38      * @param int         $flags
42 public static function initialize($flags, $parsedLineNumber = null, $parsedFilename = null) argument
44 self::$exceptionOnInvalidType = (bool) (Yaml::PARSE_EXCEPTION_ON_INVALID_TYPE & $flags);
45 self::$objectSupport = (bool) (Yaml::PARSE_OBJECT & $flags);
46 self::$objectForMap = (bool) (Yaml::PARSE_OBJECT_FOR_MAP & $flags);
47 self::$constantSupport = (bool) (Yaml::PARSE_CONSTANT & $flags);
59 … * @param int $flags A bit field of PARSE_* constants to customize the YAML parser behavior
66 public static function parse(string $value = null, int $flags = 0, array $references = []) argument
68 self::initialize($flags);
83 $tag = self::parseTag($value, $i, $flags);
86 $result = self::parseSequence($value, $flags, $i, $references);
90 $result = self::parseMapping($value, $flags, $i, $references);
94 … $result = self::parseScalar($value, $flags, null, $i, null === $tag, $references);
118 * @param int $flags A bit field of Yaml::DUMP_* constants to customize the dumped YAML string
124 public static function dump($value, int $flags = 0): string argument
128 if (Yaml::DUMP_EXCEPTION_ON_INVALID_TYPE & $flags) {
137 return '!'.$value->getTag().' '.self::dump($value->getValue(), $flags);
140 if (Yaml::DUMP_OBJECT & $flags) {
144 …if (Yaml::DUMP_OBJECT_AS_MAP & $flags && ($value instanceof \stdClass || $value instanceof \ArrayO…
148 … $output[] = sprintf('%s: %s', self::dump($key, $flags), self::dump($val, $flags));
154 if (Yaml::DUMP_EXCEPTION_ON_INVALID_TYPE & $flags) {
160 return self::dumpArray($value, $flags);
234 * @param int $flags A bit field of Yaml::DUMP_* constants to customize the dumped YAML string
238 private static function dumpArray(array $value, int $flags): string argument
241 if (($value || Yaml::DUMP_EMPTY_ARRAY_AS_SEQUENCE & $flags) && !self::isHash($value)) {
244 $output[] = self::dump($val, $flags);
253 $output[] = sprintf('%s: %s', self::dump($key, $flags), self::dump($val, $flags));
266 …public static function parseScalar(string $scalar, int $flags = 0, array $delimiters = null, int &… argument
305 $output = self::evaluateScalar($output, $flags, $references);
342 …private static function parseSequence(string $sequence, int $flags, int &$i = 0, array $references… argument
359 $tag = self::parseTag($sequence, $i, $flags);
363 $value = self::parseSequence($sequence, $flags, $i, $references);
367 $value = self::parseMapping($sequence, $flags, $i, $references);
371 … $value = self::parseScalar($sequence, $flags, [',', ']'], $i, null === $tag, $references);
378 $value = self::parseMapping('{'.$value.'}', $flags, $pos, $references);
406 …private static function parseMapping(string $mapping, int $flags, int &$i = 0, array $references =… argument
431 $key = self::parseScalar($mapping, $flags, [':', ' '], $i, false, []);
442 $evaluatedKey = self::evaluateScalar($key, $flags, $references);
464 $tag = self::parseTag($mapping, $i, $flags);
468 $value = self::parseSequence($mapping, $flags, $i, $references);
489 $value = self::parseMapping($mapping, $flags, $i, $references);
507 … $value = self::parseScalar($mapping, $flags, [',', '}'], $i, null === $tag, $references);
541 private static function evaluateScalar(string $scalar, int $flags, array $references = []) argument
643 if (Yaml::PARSE_DATETIME & $flags) {
660 private static function parseTag(string $value, int &$i, int $flags): ?string argument
685 if ('' === $tag || Yaml::PARSE_CUSTOM_TAGS & $flags) {