Passed
Push — master ( b8922c...f524c3 )
by Harry Osmar
34s
created

HelloWorld::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 2
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: harry
5
 * Date: 2/12/18
6
 * Time: 5:20 PM
7
 */
8
9
namespace PhpBootstrap\Controller;
10
11
use PhpBootstrap\Contracts\Hello as HelloInterface;
12
use PhpBootstrap\Contracts\Response as ResponseInterface;
13
use Psr\Http\Message\ServerRequestInterface;
14
15
class HelloWorld extends Base
16
{
17
    public function sayHi(ServerRequestInterface $request, ResponseInterface $response, array $args)
0 ignored issues
show
Unused Code introduced by
The parameter $request is not used and could be removed.

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

Loading history...
18
    {
19
        /** @var HelloInterface $hello */
20
        $hello = $this->container->get(HelloInterface::class);
21
22
        return $response->withArray(
23
            [
24
                'message' => sprintf('%s %s', $hello->sayHi(), $args['name'])
25
            ],
26
            200
27
        );
28
    }
29
}