Skip to content

Commit

Permalink
Code updates
Browse files Browse the repository at this point in the history
  • Loading branch information
javiereguiluz authored and nicolas-grekas committed Dec 18, 2023
1 parent 0055b23 commit 2c98dad
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Dumper.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ private function getBlockIndentationIndicator(string $value): string
// http://www.yaml.org/spec/1.2/spec.html#id2793979
foreach ($lines as $line) {
if ('' !== trim($line, ' ')) {
return (' ' === substr($line, 0, 1)) ? (string) $this->indentation : '';
return str_starts_with($line, ' ') ? (string) $this->indentation : '';
}
}

Expand Down
2 changes: 1 addition & 1 deletion Escaper.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public static function requiresSingleQuoting(string $value): bool

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

/**
Expand Down

0 comments on commit 2c98dad

Please sign in to comment.