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

ViewHandler::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 0
dl 0
loc 5
ccs 1
cts 1
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 3
crap 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