Lines
100.00%
9 / 9
Methods
100.00%
1 / 1
Classes
100.00%
1 / 1
| Name | Lines | Methods | CRAP | ||||
|---|---|---|---|---|---|---|---|
| __invoke | 100.00% | 9 / 9 | 100.00% | 1 / 1 | 1 | ||
| 21 | final class AgentStatIndex extends BaseController | |
| 22 | { | |
| 23 | public function __invoke(AgentStatRepository $agentStatRepository): JsonResponse | |
| 24 | { | |
| 25 | return $this->json(\array_map( | |
| 26 | static fn (AgentStat $agentStat): array => [ | |
| 27 | 'id' => $agentStat->id, | |
| 28 | 'datetime' => $agentStat->datetime->format(AgentStatInput::DATETIME_FORMAT), | |
| 29 | 'nickname' => $agentStat->nickname, | |
| 30 | 'faction' => $agentStat->faction, | |
| 31 | ] + $agentStat->getStats(), | |
| 32 | $agentStatRepository->findByOwner($this->getUser()), | |
| 33 | )); | |
| 34 | } | |
| 35 | } |