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

RoutingResultFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 3
dl 0
loc 12
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A success() 0 4 1
A failure() 0 4 1
1
<?php
2
declare(strict_types=1);
3
4
namespace N1215\Http\Router\Result;
5
6
use N1215\Http\Router\RoutingResultFactoryInterface;
7
use N1215\Http\Router\RoutingResultInterface;
8
use Psr\Http\Server\RequestHandlerInterface;
9
10
final class RoutingResultFactory implements RoutingResultFactoryInterface
11
{
12 1
    public function success(RequestHandlerInterface $matchedHandler, array $matchedParams = []): RoutingResultInterface
13
    {
14 1
        return new RoutingSuccess($matchedHandler, $matchedParams);
15
    }
16
17 1
    public function failure(int $statusCode, string $message): RoutingResultInterface
18
    {
19 1
        return new RoutingFailure(new RoutingError($statusCode, $message));
20
    }
21
}
22