Skip to content

Commit

Permalink
Merge branch '5.4' into 6.0
Browse files Browse the repository at this point in the history
* 5.4:
  [Form] Backport type fixes
  [ExpressionLanguage] Store compiler and evaluator as closures
  [Finder] Fix iterator return types
  [DependencyInjection] Support for intersection types
  • Loading branch information
derrabus committed Jul 15, 2021
2 parents 49b04fc + 87fc813 commit e3d5d00
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions ExpressionFunction.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,29 @@ class ExpressionFunction
public function __construct(string $name, callable $compiler, callable $evaluator)
{
$this->name = $name;
$this->compiler = $compiler;
$this->evaluator = $evaluator;
$this->compiler = $compiler instanceof \Closure ? $compiler : \Closure::fromCallable($compiler);
$this->evaluator = $evaluator instanceof \Closure ? $evaluator : \Closure::fromCallable($evaluator);
}

/**
* @return string
*/
public function getName()
{
return $this->name;
}

/**
* @return \Closure
*/
public function getCompiler()
{
return $this->compiler;
}

/**
* @return \Closure
*/
public function getEvaluator()
{
return $this->evaluator;
Expand Down

0 comments on commit e3d5d00

Please sign in to comment.