private function PhpDumper::export in Service Container 7
Same name and namespace in other branches
- 7.2 modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php \Symfony\Component\DependencyInjection\Dumper\PhpDumper::export()
2 calls to PhpDumper::export()
- PhpDumper::dumpValue in modules/
providers/ service_container_symfony/ lib/ Symfony/ Component/ DependencyInjection/ Dumper/ PhpDumper.php - Dumps values.
- PhpDumper::exportParameters in modules/
providers/ service_container_symfony/ lib/ Symfony/ Component/ DependencyInjection/ Dumper/ PhpDumper.php - Exports parameters.
File
- modules/
providers/ service_container_symfony/ lib/ Symfony/ Component/ DependencyInjection/ Dumper/ PhpDumper.php, line 1535
Class
- PhpDumper
- PhpDumper dumps a service container as a PHP class.
Namespace
Symfony\Component\DependencyInjection\DumperCode
private function export($value) {
if (null !== $this->targetDirRegex && is_string($value) && preg_match($this->targetDirRegex, $value, $matches, PREG_OFFSET_CAPTURE)) {
$prefix = $matches[0][1] ? var_export(substr($value, 0, $matches[0][1]), true) . '.' : '';
$suffix = $matches[0][1] + strlen($matches[0][0]);
$suffix = isset($value[$suffix]) ? '.' . var_export(substr($value, $suffix), true) : '';
$dirname = '__DIR__';
if (0 < ($offset = 1 + $this->targetDirMaxMatches - count($matches))) {
$dirname = sprintf('$this->targetDirs[%d]', $offset);
}
if ($prefix || $suffix) {
return sprintf('(%s%s%s)', $prefix, $dirname, $suffix);
}
return $dirname;
}
return var_export($value, true);
}