| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 33 | 2 | public function build(Specification $spec, QueryBuilder $qb) |
|
| 34 | { |
||
| 35 | 2 | if (!$spec instanceof AndX) { |
|
| 36 | 1 | throw new \InvalidArgumentException(); |
|
| 37 | } |
||
| 38 | |||
| 39 | 1 | $firstPartBuilder = $this->registry->getBuilder($spec->getFirstPart()); |
|
| 40 | 1 | $secondPartBuilder = $this->registry->getBuilder($spec->getFirstPart()); |
|
| 41 | |||
| 42 | 1 | return $qb->query()->bool() |
|
| 43 | 1 | ->addMust($firstPartBuilder->build($spec->getFirstPart(), $qb)) |
|
| 44 | 1 | ->addMust($secondPartBuilder->build($spec->getSecondPart(), $qb)) |
|
| 45 | ; |
||
| 46 | } |
||
| 47 | } |
||
| 48 |