| Conditions | 1 |
| Paths | 1 |
| Total Lines | 17 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 1.1623 |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | 1 | public static function build(): iterable |
|
| 16 | { |
||
| 17 | 1 | yield 'recordSearch' => fn () => [ |
|
| 18 | 1 | 'type' => Type::nonNull(Type::boolean()), |
|
| 19 | 1 | 'description' => 'Record one search in statistics', |
|
| 20 | 1 | 'resolve' => function ($root, array $args): bool { |
|
|
|
|||
| 21 | /** @var Site $site */ |
||
| 22 | $site = $root['site']; |
||
| 23 | |||
| 24 | /** @var StatisticRepository $statisticRepository */ |
||
| 25 | $statisticRepository = _em()->getRepository(Statistic::class); |
||
| 26 | $statistic = $statisticRepository->getOrCreate($site); |
||
| 27 | $statistic->recordSearch(); |
||
| 28 | |||
| 29 | _em()->flush(); |
||
| 30 | |||
| 31 | return true; |
||
| 32 | 1 | }, |
|
| 36 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.