RouteContext::getParameters()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
ccs 2
cts 2
cp 1
cc 1
nc 1
nop 0
crap 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