diff --git a/core/lib/Drupal/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumper.php b/core/lib/Drupal/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumper.php index 11768d0c20..d42b4c6d1d 100644 --- a/core/lib/Drupal/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumper.php +++ b/core/lib/Drupal/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumper.php @@ -309,10 +309,10 @@ protected function dumpCollection($collection, &$resolve = FALSE) { } } else { - if (is_object($value)) { + $code[$key] = $this->dumpValue($value); + if (is_object($code[$key])) { $resolve = TRUE; } - $code[$key] = $this->dumpValue($value); } } @@ -403,6 +403,9 @@ protected function dumpValue($value) { elseif ($value instanceof Parameter) { return $this->getParameterCall((string) $value); } + elseif (preg_match('/^\%(.*)\%$/', $value, $matches)) { + return $this->getParameterCall($matches[1]); + } elseif ($value instanceof Expression) { throw new RuntimeException('Unable to use expressions as the Symfony ExpressionLanguage component is not installed.'); }