| Total Complexity | 2 |
| Total Lines | 25 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | final class UserAddCommand extends Command |
||
| 12 | { |
||
| 13 | 1 | public function __construct( |
|
| 14 | private readonly ContainerInterface $dic |
||
|
|
|||
| 15 | ) { |
||
| 16 | 1 | parent::__construct( |
|
| 17 | 'user:add', |
||
| 18 | 'Adds an user' |
||
| 19 | ); |
||
| 20 | |||
| 21 | $this |
||
| 22 | 1 | ->argument( |
|
| 23 | '<username>', |
||
| 24 | 'User name' |
||
| 25 | ) |
||
| 26 | 1 | ->usage( |
|
| 27 | '<bold> $0 ua some-username</end> <comment></end> ## Adds user with name `some-username`<eol/>' |
||
| 28 | ); |
||
| 29 | } |
||
| 30 | |||
| 31 | 1 | public function execute(?string $username): void |
|
| 32 | { |
||
| 33 | 1 | $this->dic->get(UserCreationWizardInterface::class)->create( |
|
| 34 | 1 | $this->app()?->io(), |
|
| 35 | 1 | (string) $username |
|
| 36 | ); |
||
| 39 |