Test Failed
Push — master ( 5a7161...8dd580 )
by Mike
02:25
created

IndexController::indexAction()   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 4
nc 1
nop 0
dl 0
loc 6
rs 10
c 0
b 0
f 0
1
<?php
2
3
4
namespace App\Application\Business\Controller;
5
6
7
use Symfony\Component\HttpFoundation\Request;
8
use Symfony\Component\HttpFoundation\Response;
9
use Xervice\Controller\Business\Controller\AbstractController;
10
use Xervice\Core\Factory\FactoryInterface;
11
12
/**
13
 * @method \App\Application\ApplicationFactory getFactory()
14
 */
15
class IndexController extends AbstractController
16
{
17
    public function indexAction(): Response
18
    {
19
        return $this->sendResponse(
20
            sprintf(
21
                'Hello World %s',
22
                $this->getFactory()->getSessionClient()->get('name') ?: 'undefined'
23
            )
24
        );
25
    }
26
27
    /**
28
     * @param \Symfony\Component\HttpFoundation\Request $request
29
     * @param string $name
30
     *
31
     * @return \Symfony\Component\HttpFoundation\Response
32
     * @throws \Core\Locator\Dynamic\ServiceNotParseable
33
     */
34
    public function nameAction(Request $request, string $name): Response
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 nameAction(/** @scrutinizer ignore-unused */ Request $request, string $name): Response

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
        $this->getFactory()->getSessionClient()->set('name', $name);
37
38
        return $this->sendResponse(
39
            sprintf(
40
                'Set name %s',
41
                $name
42
            )
43
        );
44
    }
45
}