-
-
Notifications
You must be signed in to change notification settings - Fork 50
Expand file tree
/
Copy pathSeverityCountAction.php
More file actions
29 lines (22 loc) · 806 Bytes
/
SeverityCountAction.php
File metadata and controls
29 lines (22 loc) · 806 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
declare(strict_types=1);
namespace Setono\SyliusFeedPlugin\Controller\Action\Admin;
use Setono\SyliusFeedPlugin\Repository\ViolationRepositoryInterface;
use Symfony\Component\HttpFoundation\Response;
use Twig\Environment;
final class SeverityCountAction
{
public function __construct(
private readonly ViolationRepositoryInterface $violationRepository,
private readonly Environment $twig,
) {
}
public function __invoke(int $feed = null): Response
{
$severityCounts = $this->violationRepository->findCountsGroupedBySeverity($feed);
$content = $this->twig->render('@SetonoSyliusFeedPlugin/Admin/Violation/severity_count.html.twig', [
'severityCounts' => $severityCounts,
]);
return new Response($content);
}
}