| Total Complexity | 3 |
| Total Lines | 60 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 20 | class Token extends Command |
||
| 21 | { |
||
| 22 | /** |
||
| 23 | * Store Id. |
||
| 24 | */ |
||
| 25 | public const STORE_ID = 'store_id'; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @var ModelToken |
||
| 29 | */ |
||
| 30 | protected $token; |
||
| 31 | |||
| 32 | /** |
||
| 33 | * @var State |
||
| 34 | */ |
||
| 35 | protected $state; |
||
| 36 | |||
| 37 | /** |
||
| 38 | * @param State $state |
||
| 39 | * @param ModelToken $token |
||
| 40 | */ |
||
| 41 | public function __construct( |
||
| 42 | State $state, |
||
| 43 | ModelToken $token |
||
| 44 | ) { |
||
| 45 | $this->state = $state; |
||
| 46 | $this->token = $token; |
||
| 47 | parent::__construct(); |
||
| 48 | } |
||
| 49 | |||
| 50 | /** |
||
| 51 | * Execute. |
||
| 52 | * |
||
| 53 | * @param InputInterface $input |
||
| 54 | * @param OutputInterface $output |
||
| 55 | */ |
||
| 56 | protected function execute( |
||
| 57 | InputInterface $input, |
||
| 58 | OutputInterface $output |
||
| 59 | ) { |
||
| 60 | $this->state->setAreaCode(\Magento\Framework\App\Area::AREA_ADMINHTML); |
||
| 61 | $this->token->setOutput($output); |
||
| 62 | |||
| 63 | $storeId = $input->getArgument(self::STORE_ID); |
||
| 64 | $this->token->newToken($storeId); |
||
| 65 | } |
||
| 66 | |||
| 67 | /** |
||
| 68 | * Configure. |
||
| 69 | * |
||
| 70 | * @return void |
||
| 71 | */ |
||
| 72 | protected function configure() |
||
| 80 | } |
||
| 81 | } |
||
| 82 |