Completed
Push — master ( e835bc...32b1b0 )
by Yaroslav
11:23
created

SymfonySecurityExpressionVoter::getVariableNames()   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
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
/*
3
 *
4
 * (c) Yaroslav Honcharuk <[email protected]>
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
namespace Yarhon\RouteGuardBundle\Security\Authorization;
11
12
/**
13
 * SymfonySecurityExpressionVoter is responsible for storing information about variables used by
14
 * \Symfony\Component\Security\Core\Authorization\Voter\ExpressionVoter (there's no way to retrieve it from the original class).
15
 *
16
 * @author Yaroslav Honcharuk <[email protected]>
17
 */
18
class SymfonySecurityExpressionVoter
19
{
20
    protected static $variableNames = [
21
        'token',
22
        'user',
23
        'object',
24
        'subject',
25
        'roles',
26
        'trust_resolver',
27
        'request', // TODO: this variable is conditionally passed to evaluate
28
    ];
29
30
    /**
31
     * @return array
32
     */
33 7
    public static function getVariableNames()
34
    {
35 7
        return self::$variableNames;
36
    }
37
38
    /**
39
     * @param array $names
40
     */
41 1
    public static function setVariableNames(array $names)
42
    {
43 1
        self::$variableNames = $names;
44 1
    }
45
}
46