RouteContext::getName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Zenstruck\ObjectRoutingBundle;
4
5
/**
6
 * @author Kevin Bond <[email protected]>
7
 */
8
final class RouteContext
9
{
10
    private $name;
11
    private $parameters;
12
    private $fragment;
13
14
    /**
15
     * @param string      $name       The route name
16
     * @param array       $parameters Parameters for the route
17
     * @param string|null $fragment   Fragment ("#hash") to add to the generated uri
18
     */
19 20
    public function __construct($name, array $parameters = array(), $fragment = null)
20
    {
21 20
        $this->name = $name;
22 20
        $this->parameters = $parameters;
23 20
        $this->fragment = $fragment;
24 20
    }
25
26
    /**
27
     * @return string
28
     */
29 20
    public function getName()
30
    {
31 20
        return $this->name;
32
    }
33
34
    /**
35
     * @return array
36
     */
37 20
    public function getParameters()
38
    {
39 20
        return $this->parameters;
40
    }
41
42
    /**
43
     * @return string|null
44
     */
45 13
    public function getFragment()
46
    {
47 13
        return $this->fragment;
48
    }
49
}
50