Completed
Branch master (802455)
by n
03:24
created

RoutingFailure   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 0
dl 0
loc 30
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A isSuccess() 0 4 1
A getMatchedHandler() 0 4 1
A getMatchedParams() 0 4 1
A getError() 0 4 1
1
<?php
2
declare(strict_types=1);
3
4
namespace N1215\Http\Router\Result;
5
6
use N1215\Http\Router\RoutingErrorInterface;
7
use N1215\Http\Router\RoutingResultInterface;
8
use Psr\Http\Server\RequestHandlerInterface;
9
10
final class RoutingFailure implements RoutingResultInterface
11
{
12
    /** @var RoutingErrorInterface|null  */
13
    private $error;
14
15 3
    public function __construct(RoutingErrorInterface $error = null)
16
    {
17 3
        $this->error = $error;
18 3
    }
19
20 3
    public function isSuccess(): bool
21
    {
22 3
        return false;
23
    }
24
25 2
    public function getMatchedHandler(): ?RequestHandlerInterface
26
    {
27 2
        return null;
28
    }
29
30 2
    public function getMatchedParams(): array
31
    {
32 2
        return [];
33
    }
34
35 3
    public function getError(): ?RoutingErrorInterface
36
    {
37 3
        return $this->error;
38
    }
39
}
40