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