File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -42,20 +42,29 @@ class ExpressionFunction
42
42
public function __construct (string $ name , callable $ compiler , callable $ evaluator )
43
43
{
44
44
$ this ->name = $ name ;
45
- $ this ->compiler = $ compiler ;
46
- $ this ->evaluator = $ evaluator ;
45
+ $ this ->compiler = $ compiler instanceof \Closure ? $ compiler : \Closure:: fromCallable ( $ compiler ) ;
46
+ $ this ->evaluator = $ evaluator instanceof \Closure ? $ evaluator : \Closure:: fromCallable ( $ evaluator ) ;
47
47
}
48
48
49
+ /**
50
+ * @return string
51
+ */
49
52
public function getName ()
50
53
{
51
54
return $ this ->name ;
52
55
}
53
56
57
+ /**
58
+ * @return \Closure
59
+ */
54
60
public function getCompiler ()
55
61
{
56
62
return $ this ->compiler ;
57
63
}
58
64
65
+ /**
66
+ * @return \Closure
67
+ */
59
68
public function getEvaluator ()
60
69
{
61
70
return $ this ->evaluator ;
You can’t perform that action at this time.
0 commit comments