Skip to content

Commit 2c98dad

Browse files
javiereguiluznicolas-grekas
authored andcommitted
Code updates
1 parent 0055b23 commit 2c98dad

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Dumper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ private function getBlockIndentationIndicator(string $value): string
169169
// http://www.yaml.org/spec/1.2/spec.html#id2793979
170170
foreach ($lines as $line) {
171171
if ('' !== trim($line, ' ')) {
172-
return (' ' === substr($line, 0, 1)) ? (string) $this->indentation : '';
172+
return str_starts_with($line, ' ') ? (string) $this->indentation : '';
173173
}
174174
}
175175

Escaper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public static function requiresSingleQuoting(string $value): bool
8080

8181
// Determines if the PHP value contains any single characters that would
8282
// cause it to require single quoting in YAML.
83-
return 0 < preg_match('/[ \s \' " \: \{ \} \[ \] , & \* \# \?] | \A[ \- ? | < > = ! % @ ` \p{Zs}]/xu', $value);
83+
return 0 < preg_match('/[\s\'"\:\{\}\[\],&\*\#\?] | \A[\-?|<>=!%@`\p{Zs}]/xu', $value);
8484
}
8585

8686
/**

0 commit comments

Comments
 (0)