Completed
Pull Request — master (#1)
by
unknown
02:18
created

HelloWorld   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
c 0
b 0
f 0
lcom 0
cbo 4
dl 0
loc 15
ccs 0
cts 10
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A sayHi() 0 12 1
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
}