RouteContext   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 4
c 2
b 0
f 1
lcom 0
cbo 0
dl 0
loc 42
ccs 11
cts 11
cp 1
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getName() 0 4 1
A getParameters() 0 4 1
A getFragment() 0 4 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