| Conditions | 1 |
| Paths | 1 |
| Total Lines | 15 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 15 | public function run() |
||
| 16 | { |
||
| 17 | $module = $this->controller->module; |
||
| 18 | $keyName = $this->controller->keyName; |
||
| 19 | $secretLength = $this->controller->secretLength; |
||
| 20 | |||
| 21 | $secret = \Yii::$app->getSecurity()->generateRandomString($secretLength); |
||
| 22 | $encryptedSecret = $module->getCryptographer()->encryp($secret, $keyName); |
||
| 23 | |||
| 24 | $this->controller->stdout(Json::encode([ |
||
| 25 | 'secret' => $secret, |
||
| 26 | 'encryptedSecret' => $encryptedSecret, |
||
| 27 | ])); |
||
| 28 | |||
| 29 | return ExitCode::OK; |
||
| 30 | } |
||
| 32 |