Passed
Push — main ( a1a461...2097df )
by Thomas
12:50
created

ViewHandler   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
eloc 4
dl 0
loc 14
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A __invoke() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Conia\Chuck\Http;
6
7
use Conia\Chuck\Registry;
8
use Conia\Chuck\Response;
9
use Conia\Chuck\Route;
10
11
class ViewHandler
12
{
13 25
    public function __construct(
14
        protected readonly View $view,
15
        protected readonly Registry $registry,
16
        protected readonly Route $route,
17
    ) {
18 25
    }
19
20 24
    public function __invoke(): Response
21
    {
22 24
        return $this->view->respond(
23 24
            $this->route,
24 24
            $this->registry,
25 24
        );
26
    }
27
}
28