private function YamlDumper::dumpValue in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/symfony/dependency-injection/Dumper/YamlDumper.php \Symfony\Component\DependencyInjection\Dumper\YamlDumper::dumpValue()
Dumps the value to YAML format.
Parameters
mixed $value:
Return value
mixed
Throws
RuntimeException When trying to dump object or resource
1 call to YamlDumper::dumpValue()
- YamlDumper::addService in vendor/
symfony/ dependency-injection/ Dumper/ YamlDumper.php - Adds a service.
File
- vendor/
symfony/ dependency-injection/ Dumper/ YamlDumper.php, line 243
Class
- YamlDumper
- YamlDumper dumps a service container as a YAML string.
Namespace
Symfony\Component\DependencyInjection\DumperCode
private function dumpValue($value) {
if (is_array($value)) {
$code = array();
foreach ($value as $k => $v) {
$code[$k] = $this
->dumpValue($v);
}
return $code;
}
elseif ($value instanceof Reference) {
return $this
->getServiceCall((string) $value, $value);
}
elseif ($value instanceof Parameter) {
return $this
->getParameterCall((string) $value);
}
elseif ($value instanceof Expression) {
return $this
->getExpressionCall((string) $value);
}
elseif (is_object($value) || is_resource($value)) {
throw new RuntimeException('Unable to dump a service container if a parameter is an object or a resource.');
}
return $value;
}