EtlExecutionVoter::voteOnAttribute()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 3
1
<?php
2
3
namespace Oliverde8\PhpEtlBundle\Security;
4
5
use Oliverde8\PhpEtlBundle\Entity\EtlExecution;
6
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
0 ignored issues
show
Bug introduced by
The type Symfony\Component\Securi...on\Token\TokenInterface was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
7
use Symfony\Component\Security\Core\Authorization\Voter\Voter;
0 ignored issues
show
Bug introduced by
The type Symfony\Component\Securi...thorization\Voter\Voter was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
8
9
class EtlExecutionVoter extends Voter
10
{
11
    const QUEUE = 'queue';
12
    const VIEW = 'view';
13
    const DASHBOARD = 'dashboard';
14
    const DOWNLOAD = 'download';
15
16
    protected function supports(string $attribute, mixed $subject): bool
17
    {
18
        if ($subject == EtlExecution::class) {
19
            return true;
20
        }
21
22
        if ($subject instanceof EtlExecution) {
23
            return true;
24
        }
25
26
        return false;
27
    }
28
29
    protected function voteOnAttribute(string $attribute, mixed $subject, TokenInterface $token): bool
30
    {
31
        return true;
32
    }
33
}
34