| Total Complexity | 7 |
| Total Lines | 60 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 12 | final class LazyQuery implements QueryInterface |
||
| 13 | { |
||
| 14 | |||
| 15 | private $loadedQuery; |
||
| 16 | |||
| 17 | private $source; |
||
| 18 | |||
| 19 | private $parser; |
||
| 20 | |||
| 21 | private $astTranslator; |
||
| 22 | |||
| 23 | 7 | private $callbackBuilder; |
|
| 24 | |||
| 25 | 7 | public function __construct( |
|
| 26 | 7 | string $source, |
|
| 27 | 7 | ParserInterface $parser, |
|
| 28 | 7 | AstTranslatorInterface $astTranslator, |
|
| 29 | CallbackBuilderInterface $callbackBuilder |
||
| 30 | 3 | ) { |
|
| 31 | $this->source = $source; |
||
| 32 | 3 | $this->parser = $parser; |
|
| 33 | $this->astTranslator = $astTranslator; |
||
| 34 | $this->callbackBuilder = $callbackBuilder; |
||
| 35 | 3 | } |
|
| 36 | |||
| 37 | public function __invoke(NodeValueInterface $rootNode, RuntimeInterface $runtime): ValueListInterface |
||
| 38 | 3 | { |
|
| 39 | 3 | return $this->getLoadedQuery()($rootNode, $runtime); |
|
| 40 | } |
||
| 41 | |||
| 42 | 1 | public function getCapabilities(): CapabilitiesInterface |
|
| 43 | { |
||
| 44 | 1 | return $this |
|
| 45 | ->getLoadedQuery() |
||
| 46 | ->getCapabilities(); |
||
| 47 | 6 | } |
|
| 48 | |||
| 49 | 6 | public function getSource(): string |
|
| 50 | 6 | { |
|
| 51 | return $this->source; |
||
| 52 | } |
||
| 53 | 6 | ||
| 54 | private function getLoadedQuery(): QueryInterface |
||
| 61 | } |
||
| 62 | |||
| 63 | 6 | private function loadQuery(): QueryInterface |
|
| 64 | 6 | { |
|
| 65 | $queryAst = $this |
||
| 74 |