Augmentation vers version 3.3.0

This commit is contained in:
Gauvain Boiché
2020-03-31 15:31:03 +02:00
parent d926806907
commit a1864c0414
2618 changed files with 406015 additions and 31377 deletions

View 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) {
return [
new ExpressionFunction('service', $this->serviceCompiler ?: function ($arg) {
return sprintf('$this->get(%s)', $arg);
}, function (array $variables, $value) {
return $variables['container']->get($value);
@@ -38,6 +45,6 @@ class ExpressionLanguageProvider implements ExpressionFunctionProviderInterface
}, function (array $variables, $value) {
return $variables['container']->getParameter($value);
}),
);
];
}
}