ManagementCommand::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 11
nc 1
nop 0
dl 0
loc 14
rs 9.9
c 0
b 0
f 0
1
<?php
2
declare(strict_types = 1);
3
/**
4
 * /src/Command/User/ManagementCommand.php
5
 *
6
 * @author TLe, Tarmo Leppänen <[email protected]>
7
 */
8
9
namespace App\Command\User;
10
11
use App\Command\Traits\ExecuteMultipleCommandTrait;
12
use Symfony\Component\Console\Attribute\AsCommand;
13
use Symfony\Component\Console\Command\Command;
14
use Symfony\Component\Console\Exception\LogicException;
15
16
/**
17
 * Class ManagementCommand
18
 *
19
 * @package App\Command\User
20
 * @author TLe, Tarmo Leppänen <[email protected]>
21
 */
22
#[AsCommand(
23
    name: 'user:management',
24
    description: 'Console command to manage users and user groups',
25
)]
26
class ManagementCommand extends Command
27
{
28
    use ExecuteMultipleCommandTrait;
29
30
    /**
31
     * ManagementCommand constructor.
32
     *
33
     * @throws LogicException
34
     */
35
    public function __construct()
36
    {
37
        parent::__construct();
38
39
        $this->setChoices([
40
            ListUsersCommand::NAME => 'List users',
41
            ListUserGroupsCommand::NAME => 'List user groups',
42
            CreateUserCommand::NAME => 'Create user',
43
            CreateUserGroupCommand::NAME => 'Create user group',
44
            EditUserCommand::NAME => 'Edit user',
45
            EditUserGroupCommand::NAME => 'Edit user group',
46
            RemoveUserCommand::NAME => 'Remove user',
47
            RemoveUserGroupCommand::NAME => 'Remove user group',
48
            '0' => 'Exit',
49
        ]);
50
    }
51
}
52