Skip to content

Commit 8151e65

Browse files
javiereguiluzfabpot
authored andcommitted
Misc code improvements and optimizations
1 parent 864837e commit 8151e65

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Dumper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ private function dumpTaggedValue(TaggedValue $value, int $inline, int $indent, i
146146
{
147147
$output = sprintf('%s!%s', $prefix ? $prefix.' ' : '', $value->getTag());
148148

149-
if (Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK & $flags && \is_string($value->getValue()) && false !== strpos($value->getValue(), "\n") && false === strpos($value->getValue(), "\r\n")) {
149+
if (Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK & $flags && \is_string($value->getValue()) && str_contains($value->getValue(), "\n") && !str_contains($value->getValue(), "\r\n")) {
150150
// If the first line starts with a space character, the spec requires a blockIndicationIndicator
151151
// http://www.yaml.org/spec/1.2/spec.html#id2793979
152152
$blockIndentationIndicator = (' ' === substr($value->getValue(), 0, 1)) ? (string) $this->indentation : '';

0 commit comments

Comments
 (0)