| Total Complexity | 6 |
| Total Lines | 41 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | final class LazyQuery implements QueryInterface |
||
| 10 | { |
||
| 11 | |||
| 12 | private $source; |
||
| 13 | |||
| 14 | private $parser; |
||
| 15 | |||
| 16 | private $loadedQuery; |
||
| 17 | |||
| 18 | 3 | public function __construct(string $source, ParserInterface $parser) |
|
| 19 | { |
||
| 20 | 3 | $this->source = $source; |
|
| 21 | 3 | $this->parser = $parser; |
|
| 22 | 3 | } |
|
| 23 | |||
| 24 | 2 | public function __invoke(NodeValueInterface $rootNode): QueryResultInterface |
|
| 25 | { |
||
| 26 | 2 | return $this->getLoadedQuery()($rootNode); |
|
| 27 | } |
||
| 28 | |||
| 29 | 1 | public function getSource(): string |
|
| 30 | { |
||
| 31 | 1 | return $this->source; |
|
| 32 | } |
||
| 33 | |||
| 34 | 2 | private function getLoadedQuery(): QueryInterface |
|
| 41 | } |
||
| 42 | |||
| 43 | 2 | private function loadQuery(): QueryInterface |
|
| 50 | ); |
||
| 51 | } |
||
| 52 | } |
||
| 53 |