| Total Complexity | 6 |
| Total Lines | 65 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 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() |
||
| 72 | } |
||
| 73 | |||
| 74 | } |
||
| 75 |