| Conditions | 3 |
| Paths | 4 |
| Total Lines | 16 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | public function generatePersonalAccessToken($clientIdentifier, $scope = null, $clientSecret = true) |
||
| 11 | { |
||
| 12 | if (property_exists(static::class, 'oauth2ModuleName')) { |
||
| 13 | $oauth2ModuleName = static::$oauth2ModuleName; |
||
| 14 | } |
||
| 15 | |||
| 16 | /** @var Oauth2Module $module */ |
||
| 17 | $module = empty($oauth2ModuleName) |
||
| 18 | ? Oauth2Module::getInstance() |
||
| 19 | : Yii::$app->getModule($oauth2ModuleName); |
||
| 20 | |||
| 21 | return $module->generatePersonalAccessToken( |
||
| 22 | $clientIdentifier, |
||
| 23 | $this->id, |
||
| 24 | $scope, |
||
| 25 | $clientSecret |
||
| 26 | ); |
||
| 29 |