| Conditions | 1 |
| Paths | 1 |
| Total Lines | 15 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 13 |
| CRAP Score | 1 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 14 | 1 | public static function build(): iterable |
|
| 15 | { |
||
| 16 | 1 | yield 'cardDomains' => fn () => [ |
|
| 17 | 1 | 'type' => Type::nonNull(Type::listOf(Type::nonNull(_types()->getOutput(Domain::class)))), |
|
| 18 | 1 | 'args' => [ |
|
| 19 | 1 | [ |
|
| 20 | 1 | 'name' => 'filter', |
|
| 21 | 1 | 'type' => _types()->getFilter(Card::class), |
|
| 22 | 1 | ], |
|
| 23 | 1 | ], |
|
| 24 | 1 | 'description' => 'List domains sorted by usage on cards filtered by given variables', |
|
| 25 | 1 | 'resolve' => function ($root, array $args): array { |
|
| 26 | 1 | $qb = _types()->createFilteredQueryBuilder(Card::class, $args['filter'], []); |
|
| 27 | |||
| 28 | 1 | return _em()->getRepository(Domain::class)->getByCards($qb); |
|
| 29 | 1 | }, |
|
| 33 |