Result::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 9.4285
cc 1
eloc 3
nc 1
nop 2
crap 1
1
<?php
2
3
namespace SimpleRoute;
4
5
final class Result implements ResultInterface
6
{
7
    /**
8
     * @var RouteInterface
9
     */
10
    private $route;
11
12
    /**
13
     * @var array
14
     */
15
    private $params;
16
17
    /**
18
     * @param RouteInterface $route
19
     * @param array $params
20
     */
21 9
    public function __construct(RouteInterface $route, array $params)
22
    {
23 9
        $this->route = $route;
24 9
        $this->params = $params;
25 9
    }
26
27
    /**
28
     * {@inheritdoc}
29
     */
30 3
    public function getHandler()
31
    {
32 3
        return $this->route->getHandler();
33
    }
34
35
    /**
36
     * {@inheritdoc}
37
     */
38 6
    public function getParams()
39
    {
40 6
        return $this->params;
41
    }
42
43
    /**
44
     * {@inheritdoc}
45
     */
46 6
    public function getRoute()
47
    {
48 6
        return $this->route;
49
    }
50
}
51