Lines Matching refs:value

42      * Dumps a PHP value to YAML.
44 * @param mixed $input The PHP value
66 foreach ($input as $key => $value) {
71 if (Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK & $flags && \is_string($value) && false !== strpos($value, "\n") && false === strpos($value, "\r")) {
74 $blockIndentationIndicator = (' ' === substr($value, 0, 1)) ? (string) $this->indentation : '';
76 if (isset($value[-2]) && "\n" === $value[-2] && "\n" === $value[-1]) {
78 } elseif ("\n" === $value[-1]) {
86 foreach (explode("\n", $value) as $row) {
97 if ($value instanceof TaggedValue) {
98 $output .= sprintf('%s%s !%s', $prefix, $dumpAsMap ? Inline::dump($key, $flags).':' : '-', $value->getTag());
100 if (Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK & $flags && \is_string($value->getValue()) && false !== strpos($value->getValue(), "\n") && false === strpos($value->getValue(), "\r\n")) {
103 $blockIndentationIndicator = (' ' === substr($value->getValue(), 0, 1)) ? (string) $this->indentation : '';
106 foreach (explode("\n", $value->getValue()) as $row) {
113 if ($inline - 1 <= 0 || null === $value->getValue() || \is_scalar($value->getValue())) {
114 $output .= ' '.$this->dump($value->getValue(), $inline - 1, 0, $flags)."\n";
117 $output .= $this->dump($value->getValue(), $inline - 1, $dumpAsMap ? $indent + $this->indentation : $indent + 2, $flags);
125 if (Yaml::DUMP_OBJECT_AS_MAP & $flags && ($value instanceof \ArrayObject || $value instanceof \stdClass)) {
126 $dumpObjectAsInlineMap = empty((array) $value);
129 $willBeInlined = $inline - 1 <= 0 || !\is_array($value) && $dumpObjectAsInlineMap || empty($value);
135 $this->dump($value, $inline - 1, $willBeInlined ? 0 : $indent + $this->indentation, $flags)
143 private function dumpTaggedValue(TaggedValue $value, int $inline, int $indent, int $flags, string $prefix): string
145 $output = sprintf('%s!%s', $prefix ? $prefix.' ' : '', $value->getTag());
147 if (Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK & $flags && \is_string($value->getValue()) && false !== strpos($value->getValue(), "\n") && false === strpos($value->getValue(), "\r\n")) {
150 $blockIndentationIndicator = (' ' === substr($value->getValue(), 0, 1)) ? (string) $this->indentation : '';
153 foreach (explode("\n", $value->getValue()) as $row) {
160 if ($inline - 1 <= 0 || null === $value->getValue() || \is_scalar($value->getValue())) {
161 return $output.' '.$this->dump($value->getValue(), $inline - 1, 0, $flags)."\n";
164 return $output."\n".$this->dump($value->getValue(), $inline - 1, $indent, $flags);