Test Failed
Push — develop ( f90d20...5ff630 )
by nguereza
04:11
created

HomeAction   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
dl 0
loc 16
c 1
b 0
f 0
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A handle() 0 6 1
A __construct() 0 4 1
1
<?php
2
3
namespace Platine\Framework\Demo\Action;
4
5
use Platine\Framework\Demo\Response\TemplateResponse;
6
use Platine\Http\Handler\RequestHandlerInterface;
7
use Platine\Http\ResponseInterface;
8
use Platine\Http\ServerRequestInterface;
9
use Platine\Template\Template;
10
11
/**
12
 * Description of HomeAction
13
 *
14
 * @author tony
15
 */
16
class HomeAction implements RequestHandlerInterface
17
{
18
    protected Template $template;
19
20
    public function __construct(
21
        Template $template
22
    ) {
23
        $this->template = $template;
24
    }
25
26
    public function handle(ServerRequestInterface $request): ResponseInterface
27
    {
28
        return new TemplateResponse(
29
            $this->template,
30
            'home',
31
            []
32
        );
33
    }
34
}
35