@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | /** |
| 16 | 16 | * @var string the unique id for the oauth2 module |
| 17 | 17 | */ |
| 18 | - public string|Module $oauth2Module = 'oauth2'; |
|
| 18 | + public string | Module $oauth2Module = 'oauth2'; |
|
| 19 | 19 | |
| 20 | 20 | /** |
| 21 | 21 | * @inheritdoc |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | protected function ensureSuccessResponse(): void |
| 56 | 56 | { |
| 57 | 57 | $response = $this->oauth2Module->getResponse(); |
| 58 | - if($response === null |
|
| 58 | + if ($response === null |
|
| 59 | 59 | || $response->isInformational() |
| 60 | 60 | || $response->isSuccessful() |
| 61 | 61 | || $response->isRedirection() |
@@ -64,7 +64,7 @@ |
||
| 64 | 64 | */ |
| 65 | 65 | public function actionAuthorize(int $authorized = 0) |
| 66 | 66 | { |
| 67 | - $response = $this->module->handleAuthorizeRequest((bool) $authorized); |
|
| 67 | + $response = $this->module->handleAuthorizeRequest((bool)$authorized); |
|
| 68 | 68 | |
| 69 | 69 | return $response->isRedirection() |
| 70 | 70 | ? $this->redirect( |
@@ -53,9 +53,9 @@ |
||
| 53 | 53 | ['scopes'], |
| 54 | 54 | function ($attribute) { |
| 55 | 55 | try { |
| 56 | - $this->getScopesList(); |
|
| 56 | + $this->getScopesList(); |
|
| 57 | 57 | } catch (IntegrityException $e) { |
| 58 | - $this->addError($atribute, $e->getMessage()); |
|
| 58 | + $this->addError($atribute, $e->getMessage()); |
|
| 59 | 59 | } |
| 60 | 60 | }, |
| 61 | 61 | 'when' => $validatedClient, |
@@ -98,7 +98,7 @@ |
||
| 98 | 98 | public function assureScope(string $scope): OauthScopes |
| 99 | 99 | { |
| 100 | 100 | if (!str_contains($this->scopes, $scope)) { |
| 101 | - $this->unknownScope($scope ); |
|
| 101 | + $this->unknownScope($scope); |
|
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | return OauthScopes::findOne($scope) ?: $this->unknownScope($scope); |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | |
| 11 | 11 | class AuthorizeAction extends \yii\base\Action |
| 12 | 12 | { |
| 13 | - public string|array $loginUri = ['/site/login']; |
|
| 13 | + public string | array $loginUri = ['/site/login']; |
|
| 14 | 14 | |
| 15 | 15 | public string $modelClass = AuthForm::class; |
| 16 | 16 | |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | |
| 19 | 19 | public ?string $modelName = ''; |
| 20 | 20 | |
| 21 | - public string|OAuth2Module $oauth2Module = 'oauth2'; |
|
| 21 | + public string | OAuth2Module $oauth2Module = 'oauth2'; |
|
| 22 | 22 | |
| 23 | 23 | public function run() |
| 24 | 24 | { |
@@ -140,13 +140,13 @@ discard block |
||
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | $storages = []; |
| 143 | - foreach(array_keys($this->storageMap) as $name) { |
|
| 143 | + foreach (array_keys($this->storageMap) as $name) { |
|
| 144 | 144 | $storages[$name] = Yii::$container->get($name); |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | $grantTypes = []; |
| 148 | - foreach($this->grantTypes as $name => $options) { |
|
| 149 | - if(!isset($storages[$name]) || empty($options['class'])) { |
|
| 148 | + foreach ($this->grantTypes as $name => $options) { |
|
| 149 | + if (!isset($storages[$name]) || empty($options['class'])) { |
|
| 150 | 150 | throw new InvalidConfigException( |
| 151 | 151 | 'Invalid grant types configuration.' |
| 152 | 152 | ); |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | */ |
| 249 | 249 | public function handleAuthorizeRequest( |
| 250 | 250 | bool $authorized, |
| 251 | - string|int $user_id |
|
| 251 | + string | int $user_id |
|
| 252 | 252 | ): Response { |
| 253 | 253 | $this->getServer()->handleAuthorizeRequest( |
| 254 | 254 | $this->getRequest(), |