diff vendor/symfony/dependency-injection/ExpressionLanguageProvider.php @ 12:7a779792577d

Update Drupal core to v8.4.5 (via Composer)
author Chris Cannam
date Fri, 23 Feb 2018 15:52:07 +0000
parents 4c8ae668cc8c
children 129ea1e6d783
line wrap: on
line diff
--- a/vendor/symfony/dependency-injection/ExpressionLanguageProvider.php	Fri Feb 23 15:51:18 2018 +0000
+++ b/vendor/symfony/dependency-injection/ExpressionLanguageProvider.php	Fri Feb 23 15:52:07 2018 +0000
@@ -24,10 +24,17 @@
  */
 class ExpressionLanguageProvider implements ExpressionFunctionProviderInterface
 {
+    private $serviceCompiler;
+
+    public function __construct(callable $serviceCompiler = null)
+    {
+        $this->serviceCompiler = $serviceCompiler;
+    }
+
     public function getFunctions()
     {
         return array(
-            new ExpressionFunction('service', function ($arg) {
+            new ExpressionFunction('service', $this->serviceCompiler ?: function ($arg) {
                 return sprintf('$this->get(%s)', $arg);
             }, function (array $variables, $value) {
                 return $variables['container']->get($value);