Total Complexity | 4 |
Total Lines | 40 |
Duplicated Lines | 0 % |
Coverage | 94.74% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
13 | final class Query implements QueryInterface |
||
14 | { |
||
15 | |||
16 | private $source; |
||
17 | |||
18 | private $callback; |
||
19 | |||
20 | private $properties; |
||
21 | |||
22 | 4 | public function __construct(string $source, callable $callback, CapabilitiesInterface $properties) |
|
27 | 4 | } |
|
28 | |||
29 | 2 | public function __invoke(NodeValueInterface $rootNode, RuntimeInterface $runtime): ValueListInterface |
|
30 | { |
||
31 | 2 | $input = (new NodeValueListBuilder) |
|
32 | 2 | ->addValue($rootNode, 0) |
|
33 | 2 | ->build(); |
|
34 | |||
35 | return call_user_func( |
||
36 | 2 | $this->callback, |
|
37 | $input, |
||
38 | 2 | $runtime->getValueListFetcher(), |
|
39 | 2 | $runtime->getEvaluator(), |
|
40 | 2 | $runtime->getLiteralFactory(), |
|
41 | 2 | $runtime->getMatcherFactory(), |
|
42 | ); |
||
43 | } |
||
44 | |||
45 | 1 | public function getCapabilities(): CapabilitiesInterface |
|
46 | { |
||
47 | 1 | return $this->properties; |
|
48 | } |
||
49 | |||
50 | 1 | public function getSource(): string |
|
53 | } |
||
54 | } |
||
55 |