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

AbstractSymfonySecurityTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
eloc 7
dl 0
loc 36
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getAttributes() 0 3 1
A getSubject() 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\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