Completed
Push — master ( 18bc97...e7bdcd )
by Yaroslav
09:10
created

AbstractSymfonySecurityTest::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
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\Security\Test;
12
13
/**
14
 * AbstractSymfonySecurityTest is a value object class for storing arguments for AuthorizationChecker::isGranted() authorization test.
15
 *
16
 * @see \Symfony\Component\Security\Core\Authorization\AuthorizationChecker::isGranted
17
 *
18
 * @author Yaroslav Honcharuk <[email protected]>
19
 */
20
abstract class AbstractSymfonySecurityTest implements TestInterface
21
{
22
    /**
23
     * @var array
24
     */
25
    private $attributes;
26
27
    /**
28
     * @var mixed
29
     */
30
    private $subject;
31
32
    /**
33
     * @param array $attributes
34
     * @param mixed $subject
35
     */
36 58
    public function __construct(array $attributes, $subject = null)
37
    {
38 58
        $this->attributes = $attributes;
39 58
        $this->subject = $subject;
40 58
    }
41
42
    /**
43
     * @return array
44
     */
45 22
    public function getAttributes()
46
    {
47 22
        return $this->attributes;
48
    }
49
50
    /**
51
     * @return mixed
52
     */
53 16
    public function getSubject()
54
    {
55 16
        return $this->subject;
56
    }
57
}
58