BaseVoter::voteOnAttribute()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 1 Features 0
Metric Value
eloc 1
c 2
b 1
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 3
1
<?php
2
3
/*
4
 * This file is part of the vseth-semesterly-reports project.
5
 *
6
 * (c) Florian Moser <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace App\Security\Voter\Base;
13
14
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
15
use Symfony\Component\Security\Core\Authorization\Voter\Voter;
16
17
abstract class BaseVoter extends Voter
18
{
19
    const VIEW = 2;
20
21
    /**
22
     * @param string $attribute
23
     * @param object $subject
24
     *
25
     * @return bool
26
     */
27
    protected function voteOnAttribute($attribute, $subject, TokenInterface $token)
28
    {
29
        return $attribute === self::VIEW;
30
    }
31
}
32