1 | <?php |
||
2 | |||
3 | /** |
||
4 | * This file is part of the `tvi/monitor-bundle` project. |
||
5 | * |
||
6 | * (c) https://github.com/turnaev/monitor-bundle/graphs/contributors |
||
7 | * |
||
8 | * For the full copyright and license information, please view the LICENSE.md |
||
9 | * file that was distributed with this source code. |
||
10 | */ |
||
0 ignored issues
–
show
Coding Style
introduced
by
![]() |
|||
11 | |||
12 | namespace Tvi\MonitorBundle\Controller; |
||
13 | |||
14 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; |
||
15 | use Symfony\Component\HttpFoundation\Request; |
||
16 | use Tvi\MonitorBundle\Runner\RunnerManager; |
||
17 | |||
18 | class UIController extends Controller |
||
0 ignored issues
–
show
|
|||
19 | { |
||
20 | use TraitCommon; |
||
21 | |||
22 | /** |
||
0 ignored issues
–
show
|
|||
23 | * @var RunnerManager |
||
24 | */ |
||
25 | protected $runnerManager; |
||
26 | |||
27 | /** |
||
0 ignored issues
–
show
|
|||
28 | * @var ?string |
||
29 | */ |
||
30 | protected $template; |
||
31 | |||
32 | 1 | public function __construct(RunnerManager $runnerManager, string $template = null) |
|
0 ignored issues
–
show
|
|||
33 | { |
||
34 | 1 | $this->runnerManager = $runnerManager; |
|
35 | 1 | $this->template = $template; |
|
36 | 1 | } |
|
37 | |||
38 | /** |
||
0 ignored issues
–
show
|
|||
39 | * @return \Symfony\Component\HttpFoundation\Response |
||
40 | */ |
||
41 | 1 | public function indexAction(Request $request) |
|
42 | { |
||
43 | 1 | list($filterIds, $filterChecks, $filterGroups, $filterTags) = $this->getFilterParams($request); |
|
44 | 1 | $filterChecks = $filterChecks ? $filterChecks : $filterIds; |
|
45 | |||
46 | 1 | $groups = $this->runnerManager->findGroups(); |
|
47 | 1 | $tags = $this->runnerManager->findTags(); |
|
48 | 1 | $checks = $this->runnerManager->findChecks(); |
|
49 | |||
50 | 1 | $selectedChecks = $this->runnerManager->findChecksSorted($filterChecks, $filterGroups, $filterTags); |
|
51 | |||
52 | 1 | return $this->render($this->template ?? '@TviMonitor/UI/index.b4.html.twig', [ |
|
0 ignored issues
–
show
|
|||
53 | 1 | 'groups' => $groups, |
|
54 | 1 | 'tags' => $tags, |
|
55 | 1 | 'checks' => $checks, |
|
56 | 1 | 'filters' => ['checks' => $filterChecks, 'groups' => $filterGroups, 'tags' => $filterTags], |
|
57 | 1 | 'selectedChecks' => $selectedChecks, |
|
58 | ]); |
||
0 ignored issues
–
show
For multi-line function calls, the closing parenthesis should be on a new line.
If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line: someFunctionCall(
$firstArgument,
$secondArgument,
$thirdArgument
); // Closing parenthesis on a new line.
![]() |
|||
59 | } |
||
60 | } |
||
61 |