Completed
Push — development ( 9736ae...1c21f9 )
by Mirco
24s queued 10s
created

TestCommand::configure()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Oc\Command;
6
7
use Oc\Security\RoleHierarchyFactory;
8
use Symfony\Component\Console\Command\Command;
9
use Symfony\Component\Console\Input\InputInterface;
10
use Symfony\Component\Console\Output\OutputInterface;
11
use Symfony\Component\DependencyInjection\ContainerInterface;
12
use Symfony\Component\Security\Core\Role\RoleHierarchyInterface;
13
use Symfony\Component\Security\Core\Security;
14
15
class TestCommand extends Command
16
{
17
18
    protected static $defaultName = 'test';
19
20
    /**
21
     * @var RoleHierarchyInterface
22
     */
23
    private $roleHierarchy;
24
    /**
25
     * @var Security
26
     */
27
    private $security;
28
29
    public function __construct(RoleHierarchyInterface $roleHierarchy, Security $security)
30
    {
31
        parent::__construct();
32
        $this->roleHierarchy = $roleHierarchy;
33
        $this->security = $security;
34
    }
35
36
    protected function configure(): void
37
    {
38
39
    }
40
41
42
    protected function execute(InputInterface $input, OutputInterface $output)
43
    {
44
        dd($this->security->isGranted('ROLE'));
45
46
        return 0;
47
    }
48
49
}
50