Completed
Push — master ( e0ba21...6292d7 )
by Vladimir
08:06
created

UIController::indexAction()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 8
ccs 0
cts 7
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
crap 2
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
PHP version not specified
Loading history...
Coding Style introduced by
Missing @category tag in file comment
Loading history...
Coding Style introduced by
Missing @package tag in file comment
Loading history...
Coding Style introduced by
Missing @author tag in file comment
Loading history...
Coding Style introduced by
Missing @license tag in file comment
Loading history...
Coding Style introduced by
Missing @link tag in file comment
Loading history...
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
Coding Style introduced by
Missing doc comment for class UIController
Loading history...
19
{
20
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
21
     * @var RunnerManager
22
     */
23
    protected $runnerManager;
24
25
26
    public function __construct(RunnerManager $runnerManager)
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function __construct()
Loading history...
27
    {
28
        $this->runnerManager = $runnerManager;
29
    }
30
31
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
Coding Style introduced by
Parameter $request should have a doc-comment as per coding-style.
Loading history...
Coding Style introduced by
Parameter $group should have a doc-comment as per coding-style.
Loading history...
32
     * @return \Symfony\Component\HttpFoundation\Response
33
     */
34
    public function indexAction(Request $request, ?string $group = null)
0 ignored issues
show
Unused Code introduced by
The parameter $request is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

34
    public function indexAction(/** @scrutinizer ignore-unused */ Request $request, ?string $group = null)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
35
    {
36
        $groups = $this->runnerManager->findGroups();
37
        $checks = $this->runnerManager->findChecks($group);
38
39
        return $this->render('@TviMonitor/ui/index.html.twig', [
0 ignored issues
show
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
40
                'groups' => $groups,
41
                'checks' => $checks,
42
            ]
43
        );
44
    }
45
}
46