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

ArgumentResolverContext::getRequest()   A

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\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