Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 9 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
| GetAdminFundPerformanceAction | |
0.00% |
0 / 9 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 1 |
| __construct | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| __invoke | |
0.00% |
0 / 8 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace App\Action\Admin; |
| 6 | |
| 7 | use App\Domain\Admin\Service\AdminFundPerformanceService; |
| 8 | use App\Renderer\JsonRenderer; |
| 9 | use Psr\Http\Message\ResponseInterface; |
| 10 | use Psr\Http\Message\ServerRequestInterface; |
| 11 | |
| 12 | final readonly class GetAdminFundPerformanceAction |
| 13 | { |
| 14 | public function __construct( |
| 15 | private AdminFundPerformanceService $service, |
| 16 | private JsonRenderer $renderer, |
| 17 | ) {} |
| 18 | |
| 19 | /** |
| 20 | * @param array<string, string> $args |
| 21 | */ |
| 22 | public function __invoke(ServerRequestInterface $request, ResponseInterface $response, array $args): ResponseInterface |
| 23 | { |
| 24 | $fundId = (string)($args['fundId'] ?? ''); |
| 25 | |
| 26 | $performance = $this->service->get12MonthPerformance($fundId); |
| 27 | |
| 28 | return $this->renderer->json($response, [ |
| 29 | 'success' => true, |
| 30 | 'data' => [ |
| 31 | 'performance' => $performance, |
| 32 | ], |
| 33 | ]); |
| 34 | } |
| 35 | } |