RouteMatch   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 20
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getAttributes() 0 3 1
A __construct() 0 4 1
A isMatch() 0 3 1
A getController() 0 3 1
1
<?php declare(strict_types=1);
2
3
namespace jschreuder\Middle\Router;
4
5
use jschreuder\Middle\Controller\ControllerInterface;
6
7
final class RouteMatch implements RouteMatchInterface
8
{
9 15
    public function __construct(
10
        private readonly ControllerInterface $controller,
11
        private readonly array $attributes = []
12 15
    ) {}
13
14 15
    public function isMatch(): bool
15
    {
16 15
        return true;
17
    }
18
19 15
    public function getController(): ControllerInterface
20
    {
21 15
        return $this->controller;
22
    }
23
24 8
    public function getAttributes(): array
25
    {
26 8
        return $this->attributes;
27
    }
28
}
29