function Dumper::getBlockIndentationIndicator
2 calls to Dumper::getBlockIndentationIndicator()
- Dumper::dump in vendor/
symfony/ yaml/ Dumper.php - Dumps a PHP value to YAML.
- Dumper::dumpTaggedValue in vendor/
symfony/ yaml/ Dumper.php
File
-
vendor/
symfony/ yaml/ Dumper.php, line 159
Class
- Dumper
- Dumper dumps PHP variables to YAML strings.
Namespace
Symfony\Component\YamlCode
private function getBlockIndentationIndicator(string $value) : string {
$lines = explode("\n", $value);
// If the first line (that is neither empty nor contains only spaces)
// starts with a space character, the spec requires a block indentation indicator
// http://www.yaml.org/spec/1.2/spec.html#id2793979
foreach ($lines as $line) {
if ('' !== trim($line, ' ')) {
return str_starts_with($line, ' ') ? (string) $this->indentation : '';
}
}
return '';
}