Lines Matching refs:flags

37     public static function initialize(int $flags, int $parsedLineNumber = null, string $parsedFilename = null)
39 self::$exceptionOnInvalidType = (bool) (Yaml::PARSE_EXCEPTION_ON_INVALID_TYPE & $flags);
40 self::$objectSupport = (bool) (Yaml::PARSE_OBJECT & $flags);
41 self::$objectForMap = (bool) (Yaml::PARSE_OBJECT_FOR_MAP & $flags);
42 self::$constantSupport = (bool) (Yaml::PARSE_CONSTANT & $flags);
54 * @param int $flags A bit field of Yaml::PARSE_* constants to customize the YAML parser behavior
61 public static function parse(string $value = null, int $flags = 0, array &$references = [])
63 self::initialize($flags);
78 $tag = self::parseTag($value, $i, $flags);
81 $result = self::parseSequence($value, $flags, $i, $references);
85 $result = self::parseMapping($value, $flags, $i, $references);
89 $result = self::parseScalar($value, $flags, null, $i, true, $references);
113 * @param int $flags A bit field of Yaml::DUMP_* constants to customize the dumped YAML string
117 public static function dump($value, int $flags = 0): string
121 if (Yaml::DUMP_EXCEPTION_ON_INVALID_TYPE & $flags) {
125 return self::dumpNull($flags);
132 return '!'.$value->getTag().' '.self::dump($value->getValue(), $flags);
135 if (Yaml::DUMP_OBJECT & $flags) {
139 if (Yaml::DUMP_OBJECT_AS_MAP & $flags && ($value instanceof \stdClass || $value instanceof \ArrayObject)) {
143 $output[] = sprintf('%s: %s', self::dump($key, $flags), self::dump($val, $flags));
149 if (Yaml::DUMP_EXCEPTION_ON_INVALID_TYPE & $flags) {
153 return self::dumpNull($flags);
155 return self::dumpArray($value, $flags);
157 return self::dumpNull($flags);
229 * @param int $flags A bit field of Yaml::DUMP_* constants to customize the dumped YAML string
231 private static function dumpArray(array $value, int $flags): string
234 if (($value || Yaml::DUMP_EMPTY_ARRAY_AS_SEQUENCE & $flags) && !self::isHash($value)) {
237 $output[] = self::dump($val, $flags);
246 $output[] = sprintf('%s: %s', self::dump($key, $flags), self::dump($val, $flags));
252 private static function dumpNull(int $flags): string
254 if (Yaml::DUMP_NULL_AS_TILDE & $flags) {
268 public static function parseScalar(string $scalar, int $flags = 0, array $delimiters = null, int &$i = 0, bool $evaluate = true, array &$references = [], bool &$isQuoted = null)
310 $output = self::evaluateScalar($output, $flags, $references, $isQuoted);
347 private static function parseSequence(string $sequence, int $flags, int &$i = 0, array &$references = []): array
364 $tag = self::parseTag($sequence, $i, $flags);
368 $value = self::parseSequence($sequence, $flags, $i, $references);
372 $value = self::parseMapping($sequence, $flags, $i, $references);
375 $value = self::parseScalar($sequence, $flags, [',', ']'], $i, null === $tag, $references, $isQuoted);
382 $value = self::parseMapping('{'.$value.'}', $flags, $pos, $references);
415 private static function parseMapping(string $mapping, int $flags, int &$i = 0, array &$references = [])
441 $key = self::parseScalar($mapping, $flags, [':', ' '], $i, false);
448 $key .= ' '.self::parseScalar($mapping, $flags, [':'], $i, false);
449 $key = self::evaluateScalar($key, $flags);
457 $evaluatedKey = self::evaluateScalar($key, $flags, $references);
479 $tag = self::parseTag($mapping, $i, $flags);
483 $value = self::parseSequence($mapping, $flags, $i, $references);
504 $value = self::parseMapping($mapping, $flags, $i, $references);
522 $value = self::parseScalar($mapping, $flags, [',', '}', "\n"], $i, null === $tag, $references, $isValueQuoted);
561 private static function evaluateScalar(string $scalar, int $flags, array &$references = [], bool &$isQuotedString = null)
702 if (Yaml::PARSE_DATETIME & $flags) {
721 private static function parseTag(string $value, int &$i, int $flags): ?string
754 if ('' === $tag || Yaml::PARSE_CUSTOM_TAGS & $flags) {