function Inline::dumpArray
Dumps a PHP array to a YAML string.
Parameters
array $value The PHP array to dump:
int $flags A bit field of Yaml::DUMP_* constants to customize the dumped YAML string:
1 call to Inline::dumpArray()
- Inline::dump in vendor/
symfony/ yaml/ Inline.php - Dumps a given PHP variable to a YAML string.
File
-
vendor/
symfony/ yaml/ Inline.php, line 221
Class
- Inline
- Inline implements a YAML parser/dumper for the YAML inline syntax.
Namespace
Symfony\Component\YamlCode
private static function dumpArray(array $value, int $flags) : string {
// array
if (($value || Yaml::DUMP_EMPTY_ARRAY_AS_SEQUENCE & $flags) && !self::isHash($value)) {
$output = [];
foreach ($value as $val) {
$output[] = self::dump($val, $flags);
}
return \sprintf('[%s]', implode(', ', $output));
}
return self::dumpHashArray($value, $flags);
}