Manager::getRole()   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 0
1
<?php
2
3
namespace PortlandLabs\Slackbot\Command\Argument;
4
5
use League\CLImate\Argument\Manager as ArgumentManager;
6
7
class Manager extends ArgumentManager
8
{
9
10
    /** @var string */
11
    protected $command;
12
13
    /** @var string The Role required */
14
    protected $role;
15
16
    /**
17
     * Manage parsing the incoming $argv
18
     *
19
     * @param string[] $argv
20
     * @throws \Exception
21
     */
22
    public function parse(array $argv = null)
23
    {
24
        $this->command = $this->parser->command($argv);
25
        parent::parse($argv);
26
    }
27
28
    /**
29
     * Get the command these arguments are associated with
30
     *
31
     * @return string
32
     */
33
    public function getCommand()
34
    {
35
        return $this->command;
36
    }
37
38
    /**
39
     * Set the command that is associated with these arguments
40
     *
41
     * @param string $command
42
     */
43
    public function setCommand(string $command)
44
    {
45
        $this->command = $command;
46
    }
47
48
    /**
49
     * @return string
50
     */
51
    public function getRole(): string
52
    {
53
        return $this->role;
54
    }
55
56
    /**
57
     * @param string $role
58
     */
59
    public function setRole(string $role): void
60
    {
61
        $this->role = $role;
62
    }
63
64
    /**
65
     * Manage cloning arguments on clone
66
     */
67
    public function __clone()
68
    {
69
        $this->arguments = array_map(function($item) {
70
            return clone $item;
71
        }, $this->arguments);
72
    }
73
74
}
75