Completed
Push — master ( a52764...802455 )
by n
59:28
created

RoutingSuccess::getMatchedHandler()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 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 RoutingSuccess implements RoutingResultInterface
11
{
12
    /** @var RequestHandlerInterface|null  */
13
    private $matchedHandler;
14
15
    /** @var array  */
16
    private $matchedParams;
17
18 3
    public function __construct(?RequestHandlerInterface $matchedHandler, array $matchedParams = [])
19
    {
20 3
        $this->matchedHandler = $matchedHandler;
21 3
        $this->matchedParams = $matchedParams;
22 3
    }
23
24 3
    public function isSuccess(): bool
25
    {
26 3
        return true;
27
    }
28
29 3
    public function getMatchedHandler(): ?RequestHandlerInterface
30
    {
31 3
        return $this->matchedHandler;
32
    }
33
34 3
    public function getMatchedParams(): array
35
    {
36 3
        return $this->matchedParams;
37
    }
38
39 2
    public function getError(): ?RoutingErrorInterface
40
    {
41 2
        return null;
42
    }
43
}
44