ViewHandler   A
last analyzed

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\Route;
9
use Psr\Http\Message\ResponseInterface as PsrResponse;
10
11
class ViewHandler
12
{
13 24
    public function __construct(
14
        protected readonly View $view,
15
        protected readonly Registry $registry,
16
        protected readonly Route $route,
17
    ) {
18 24
    }
19
20 23
    public function __invoke(): PsrResponse
21
    {
22 23
        return $this->view->respond(
23 23
            $this->route,
24 23
            $this->registry,
25 23
        );
26
    }
27
}
28