RouteContext   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getName() 0 3 1
A __construct() 0 5 1
A getMethod() 0 3 1
A getParameters() 0 3 1
1
<?php
2
3
/*
4
 *
5
 * (c) Yaroslav Honcharuk <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Yarhon\RouteGuardBundle\Routing;
12
13
/**
14
 * @author Yaroslav Honcharuk <[email protected]>
15
 */
16
class RouteContext implements RouteContextInterface
17
{
18
    /**
19
     * @var string
20
     */
21
    private $name;
22
23
    /**
24
     * @var array
25
     */
26
    private $parameters;
27
28
    /**
29
     * @var string
30
     */
31
    private $method;
32
33
    /**
34
     * @param string $name
35
     * @param array  $parameters
36
     * @param string $method
37
     */
38 67
    public function __construct($name, array $parameters = [], $method = 'GET')
39
    {
40 67
        $this->name = $name;
41 67
        $this->parameters = $parameters;
42 67
        $this->method = $method;
43 67
    }
44
45
    /**
46
     * {@inheritdoc}
47
     */
48 44
    public function getName()
49
    {
50 44
        return $this->name;
51
    }
52
53
    /**
54
     * {@inheritdoc}
55
     */
56 25
    public function getParameters()
57
    {
58 25
        return $this->parameters;
59
    }
60
61
    /**
62
     * {@inheritdoc}
63
     */
64 14
    public function getMethod()
65
    {
66 14
        return $this->method;
67
    }
68
}
69