Conditions | 2 |
Paths | 2 |
Total Lines | 15 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
23 | 1 | public function __invoke(ResolverContext $context, $root) |
|
24 | { |
||
25 | 1 | $language = new ExpressionLanguage(); |
|
26 | 1 | if ($context->getDefinition()->hasMeta('expression')) { |
|
27 | 1 | $expression = $context->getDefinition()->getMeta('expression'); |
|
28 | |||
29 | 1 | return $language->evaluate( |
|
30 | 1 | $expression, |
|
31 | [ |
||
32 | 1 | 'this' => $root, |
|
33 | ] |
||
34 | ); |
||
35 | } |
||
36 | |||
37 | 1 | return null; |
|
38 | } |
||
40 |