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