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