Security update for Core, with self-updated composer
[yaffs-website] / vendor / symfony / dependency-injection / ExpressionLanguageProvider.php
index ce6d69522e19127631ad4ae534e441119e4f6a5c..e2084aa85da6d88b7e59352aee83b053482c1da7 100644 (file)
@@ -24,10 +24,17 @@ use Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface;
  */
 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);