$escapedValue = preg_replace_callback('/%%|%([^%\s]++)%/', function ($match) use ($container, $value) {
44
// skip %%
45
6
if (!isset($match[1])) {
46
6
return '%%';
47
}
48
49
6
$resolved = $container->getParameter($match[1]);
50
6
if (is_string($resolved) || is_numeric($resolved)) {
51
6
return (string) $resolved;
52
}
53
54
throw new \RuntimeException(sprintf('The container parameter "%s" must be a string or numeric, but it is of type %s.', $match[1], gettype($resolved)));