Lines Matching refs:value
74 * @param string $value A YAML string
81 public function parse(string $value, int $flags = 0) argument
83 if (false === preg_match('//u', $value)) {
97 $data = $this->doParse($value, $flags);
116 private function doParse(string $value, int $flags) argument
120 $value = $this->cleanup($value);
121 $this->lines = explode("\n", $value);
270 $value = $values['value'];
272 $value = $this->getNextEmbedBlock();
274 … $parsed = $this->parseBlock($this->getRealCurrentLineNb() + 1, $value, $flags);
332 … $value = $this->parseBlock($this->getRealCurrentLineNb() + 1, $this->getNextEmbedBlock(), $flags);
334 $this->refs[$refMatches['ref']] = $value;
336 … if (Yaml::PARSE_OBJECT_FOR_MAP & $flags && $value instanceof \stdClass) {
337 $value = (array) $value;
340 $data += $value;
345 $data[$key] = new TaggedValue($subTag, $value);
347 $data[$key] = $value;
354 $value = $this->parseValue(rtrim($values['value']), $flags, $context);
358 $data[$key] = $value;
433 if (\is_string($value) && $this->lines[0] === trim($value)) {
435 $value = Inline::parse($this->lines[0], $flags, $this->refs);
443 return $value;
450 $value = '';
467 $value .= "\n";
469 $value .= ' ';
473 $value .= ltrim(substr($line, 0, -1));
475 $value .= $trimmedLine;
491 return Inline::parse(trim($value));
508 foreach ($data as $key => $value) {
509 $object->$key = $value;
713 * @param string $value A YAML value
721 private function parseValue(string $value, int $flags, string $context) argument
723 if (0 === strpos($value, '*')) {
724 if (false !== $pos = strpos($value, '#')) {
725 $value = substr($value, 1, $pos - 2);
727 $value = substr($value, 1);
730 if (!\array_key_exists($value, $this->refs)) {
731 if (false !== $pos = array_search($value, $this->refsBeingParsed, true)) {
732 …ode(', ', array_merge(\array_slice($this->refsBeingParsed, $pos), [$value])), $value), $this->curr…
735 …throw new ParseException(sprintf('Reference "%s" does not exist.', $value), $this->currentLineNb +…
738 return $this->refs[$value];
741 …in_array($value[0], ['!', '|', '>'], true) && self::preg_match('/^(?:'.self::TAG_PATTERN.' +)?'.se…
758 if ('' !== $value && '{' === $value[0]) {
759 $cursor = \strlen(rtrim($this->currentLine)) - \strlen(rtrim($value));
762 } elseif ('' !== $value && '[' === $value[0]) {
763 $cursor = \strlen(rtrim($this->currentLine)) - \strlen(rtrim($value));
768 switch ($value[0] ?? '') {
771 $cursor = \strlen(rtrim($this->currentLine)) - \strlen(rtrim($value));
795 $value .= "\n";
798 $value .= $lines[$i];
801 $value .= ' '.$lines[$i];
808 $parsedValue = Inline::parse($value, $flags, $this->refs);
810 …tring($parsedValue) && '"' !== $value[0] && "'" !== $value[0] && '[' !== $value[0] && '{' !== $val…
811 …e used in an unquoted mapping value.', $this->getRealCurrentLineNb() + 1, $value, $this->filename);
999 * @param string $value The input YAML string
1001 private function cleanup(string $value): string argument
1003 $value = str_replace(["\r\n", "\r"], "\n", $value);
1007 $value = preg_replace('#^\%YAML[: ][\d\.]+.*\n#u', '', $value, -1, $count);
1011 $trimmedValue = preg_replace('#^(\#.*?\n)+#s', '', $value, -1, $count);
1014 $this->offset += substr_count($value, "\n") - substr_count($trimmedValue, "\n");
1015 $value = $trimmedValue;
1019 $trimmedValue = preg_replace('#^\-\-\-.*?\n#s', '', $value, -1, $count);
1022 $this->offset += substr_count($value, "\n") - substr_count($trimmedValue, "\n");
1023 $value = $trimmedValue;
1026 $value = preg_replace('#\.\.\.\s*$#', '', $value);
1029 return $value;
1117 private function trimTag(string $value): string argument
1119 if ('!' === $value[0]) {
1120 return ltrim(substr($value, 1, strcspn($value, " \r\n", 1)), ' ');
1123 return $value;
1126 private function getLineTag(string $value, int $flags, bool $nextLineCheck = true): ?string argument
1128 …if ('' === $value || '!' !== $value[0] || 1 !== self::preg_match('/^'.self::TAG_PATTERN.' *( +#.*)…
1140 …tag "!%s" is not implemented.', $tag), $this->getRealCurrentLineNb() + 1, $value, $this->filename);
1147 …TAGS" to use "%s".', $matches['tag']), $this->getRealCurrentLineNb() + 1, $value, $this->filename);
1153 $value = $quotation;
1166 $value .= "\n";
1168 $value .= ' ';
1175 $value .= '\\';
1177 $value .= '\\'.$this->currentLine[$cursor];
1185 $value .= "''";
1189 return $value.$quotation;
1191 $value .= $this->currentLine[$cursor];
1238 $value = $this->currentLine[$cursor];
1248 $value .= $this->lexInlineQuotedString($cursor);
1252 $value .= $this->currentLine[$cursor];
1256 $value .= $this->lexInlineMapping($cursor);
1259 $value .= $this->lexInlineSequence($cursor);
1262 $value .= $this->currentLine[$cursor];
1265 return $value;
1269 $value .= $this->lexUnquotedString($cursor);
1273 $value .= ' ';