Completed
Branch master (c0d8ef)
by Yaroslav
06:36
created

ArgumentResolverContext   A

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 __construct() 0 5 1
A getControllerName() 0 3 1
A getRequest() 0 3 1
A getAttributes() 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\Controller\ArgumentResolver;
12
13
use Symfony\Component\HttpFoundation\Request;
14
use Symfony\Component\HttpFoundation\ParameterBag;
15
16
/**
17
 * @author Yaroslav Honcharuk <[email protected]>
18
 */
19
class ArgumentResolverContext implements ArgumentResolverContextInterface
20
{
21
    /**
22
     * @var Request
23
     */
24
    private $request;
25
26
    /**
27
     * @var ParameterBag
28
     */
29
    private $attributes;
30
31
    /**
32
     * @var string
33
     */
34
    private $controllerName;
35
36
    /**
37
     * @param Request|null $request
38
     * @param ParameterBag $attributes
39
     * @param string       $controllerName
40
     */
41 8
    public function __construct(ParameterBag $attributes, $controllerName, Request $request = null)
42
    {
43 8
        $this->request = $request;
44 8
        $this->attributes = $attributes;
45 8
        $this->controllerName = $controllerName;
46 8
    }
47
48
    /**
49
     * {@inheritdoc}
50
     */
51 3
    public function getRequest()
52
    {
53 3
        return $this->request;
54
    }
55
56
    /**
57
     * {@inheritdoc}
58
     */
59 3
    public function getAttributes()
60
    {
61 3
        return $this->attributes;
62
    }
63
64
    /**
65
     * {@inheritdoc}
66
     */
67 3
    public function getControllerName()
68
    {
69 3
        return $this->controllerName;
70
    }
71
}
72