Lines Matching refs:value

72      * @param string $value A YAML string
79 public function parse(string $value, int $flags = 0) argument
81 if (false === preg_match('//u', $value)) {
96 $data = $this->doParse($value, $flags);
121 private function doParse(string $value, int $flags) argument
125 $value = $this->cleanup($value);
126 $this->lines = explode("\n", $value);
261 $value = $values['value'];
263 $value = $this->getNextEmbedBlock();
265 … $parsed = $this->parseBlock($this->getRealCurrentLineNb() + 1, $value, $flags);
323 … $value = $this->parseBlock($this->getRealCurrentLineNb() + 1, $this->getNextEmbedBlock(), $flags);
325 $this->refs[$refMatches['ref']] = $value;
327 … if (Yaml::PARSE_OBJECT_FOR_MAP & $flags && $value instanceof \stdClass) {
328 $value = (array) $value;
331 $data += $value;
336 $data[$key] = new TaggedValue($subTag, $value);
338 $data[$key] = $value;
345 $value = $this->parseValue(rtrim($values['value']), $flags, $context);
349 $data[$key] = $value;
369 if (\is_string($value) && $this->lines[0] === trim($value)) {
371 $value = Inline::parse($this->lines[0], $flags, $this->refs);
379 return $value;
386 $value = '';
394 $value .= "\n";
396 $value .= ' ';
400 $value .= ltrim(substr($line, 0, -1));
402 $value .= trim($line);
418 return Inline::parse(trim($value));
435 foreach ($data as $key => $value) {
436 $object->$key = $value;
634 * @param string $value A YAML value
642 private function parseValue(string $value, int $flags, string $context) argument
644 if (0 === strpos($value, '*')) {
645 if (false !== $pos = strpos($value, '#')) {
646 $value = substr($value, 1, $pos - 2);
648 $value = substr($value, 1);
651 if (!\array_key_exists($value, $this->refs)) {
652 if (false !== $pos = array_search($value, $this->refsBeingParsed, true)) {
653 …e "%s".', implode(', ', \array_slice($this->refsBeingParsed, $pos)), $value, $value), $this->curre…
656 …throw new ParseException(sprintf('Reference "%s" does not exist.', $value), $this->currentLineNb +…
659 return $this->refs[$value];
662 …in_array($value[0], ['!', '|', '>'], true) && self::preg_match('/^(?:'.self::TAG_PATTERN.' +)?'.se…
679 … $quotation = '' !== $value && ('"' === $value[0] || "'" === $value[0]) ? $value[0] : null;
682 … (null !== $quotation && self::preg_match('/^'.$quotation.'.*'.$quotation.'(\s*#.*)?$/', $value)) {
683 return Inline::parse($value, $flags, $this->refs);
706 $value .= "\n";
709 $value .= $lines[$i];
712 $value .= ' '.$lines[$i];
719 $parsedValue = Inline::parse($value, $flags, $this->refs);
721 …tring($parsedValue) && '"' !== $value[0] && "'" !== $value[0] && '[' !== $value[0] && '{' !== $val…
722 …e used in an unquoted mapping value.', $this->getRealCurrentLineNb() + 1, $value, $this->filename);
919 * @param string $value The input YAML string
923 private function cleanup(string $value): string argument
925 $value = str_replace(["\r\n", "\r"], "\n", $value);
929 $value = preg_replace('#^\%YAML[: ][\d\.]+.*\n#u', '', $value, -1, $count);
933 $trimmedValue = preg_replace('#^(\#.*?\n)+#s', '', $value, -1, $count);
936 $this->offset += substr_count($value, "\n") - substr_count($trimmedValue, "\n");
937 $value = $trimmedValue;
941 $trimmedValue = preg_replace('#^\-\-\-.*?\n#s', '', $value, -1, $count);
944 $this->offset += substr_count($value, "\n") - substr_count($trimmedValue, "\n");
945 $value = $trimmedValue;
948 $value = preg_replace('#\.\.\.\s*$#', '', $value);
951 return $value;
1043 private function trimTag(string $value): string argument
1045 if ('!' === $value[0]) {
1046 return ltrim(substr($value, 1, strcspn($value, " \r\n", 1)), ' ');
1049 return $value;
1052 private function getLineTag(string $value, int $flags, bool $nextLineCheck = true): ?string argument
1054 …if ('' === $value || '!' !== $value[0] || 1 !== self::preg_match('/^'.self::TAG_PATTERN.' *( +#.*)…
1066 …tag "!%s" is not implemented.', $tag), $this->getRealCurrentLineNb() + 1, $value, $this->filename);
1073 …TAGS" to use "%s".', $matches['tag']), $this->getRealCurrentLineNb() + 1, $value, $this->filename);