Skip to content

Commit afaec89

Browse files
authored
Merge pull request #14 from rossaddison/analysis-oLL7yK
Apply fixes from StyleCI
2 parents c257970 + 277fc1d commit afaec89

21 files changed

+105
-109
lines changed

src/Asset/AuthChoiceAsset.php

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,33 +15,33 @@ class AuthChoiceAsset extends AssetBundle
1515
{
1616
/**
1717
* Note: Aliases convert to actual file paths
18-
* $basePath (below) is normally the publically accessible target path where $sourcePath
19-
* files are copied to.
18+
* $basePath (below) is normally the publically accessible target path where $sourcePath
19+
* files are copied to.
2020
* 1. Check that your application's config/common/params.php yiisoft/aliases['aliases']
21-
* contains '@assets' alias e.g.
22-
*
23-
* '@root' => dirname(__DIR__, 2),
21+
* contains '@assets' alias e.g.
22+
*
23+
* '@root' => dirname(__DIR__, 2),
2424
* '@assets' => '@root/public/assets',
2525
* '@assetsUrl' => '@baseUrl/assets',
26-
* '@vendor' => '@root/vendor',
27-
*
26+
* '@vendor' => '@root/vendor',
27+
*
2828
* 2. Check that '@assetsUrl' is also listed
2929
* 3. Check that the '@vendor' alias is also included as above.
3030
* 4. The alias should point to public/assets as seen above
31-
* 5. The public/assets folder's 8 digit subfolder e.g. ab615tyu will only
31+
* 5. The public/assets folder's 8 digit subfolder e.g. ab615tyu will only
3232
* be included ... if the sourcePath files do not already exist in a pre-existing folder
33-
* e.g. tr674trs
34-
* 6. Register the Asset in your application's layout file e.g.
33+
* e.g. tr674trs
34+
* 6. Register the Asset in your application's layout file e.g.
3535
* resources/views/layout/main.php
36-
*
36+
*
3737
* @var string|null
38-
*/
38+
*/
3939
public ?string $basePath = '@assets';
40-
40+
4141
public ?string $baseUrl = '@assetsUrl';
42-
42+
4343
public ?string $sourcePath = '@vendor/yiisoft/yii-auth-client/resources/assets';
44-
44+
4545
/**
4646
* @psalm-suppress NonInvariantDocblockPropertyType $js
4747
*/
@@ -52,4 +52,4 @@ class AuthChoiceAsset extends AssetBundle
5252
public array $depends = [
5353
AuthChoiceStyleAsset::class,
5454
];
55-
}
55+
}

src/Asset/AuthChoiceStyleAsset.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
class AuthChoiceStyleAsset extends AssetBundle
1313
{
1414
public ?string $basePath = '@assets';
15-
15+
1616
public ?string $baseUrl = '@assetsUrl';
17-
17+
1818
public ?string $sourcePath = '@vendor/yiisoft/yii-auth-client/resources/assets';
1919

2020
/**

src/AuthAction.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
use Yiisoft\Http\Status;
1616
use Yiisoft\View\Exception\ViewNotFoundException;
1717
use Yiisoft\View\WebView;
18-
use Yiisoft\Yii\AuthClient\Collection;
1918
use Yiisoft\Yii\AuthClient\Exception\InvalidConfigException;
2019
use Yiisoft\Yii\AuthClient\Exception\NotSupportedException;
2120

@@ -115,7 +114,7 @@ final class AuthAction implements MiddlewareInterface
115114
* @var string the redirect url after unsuccessful authorization (e.g. user canceled).
116115
*/
117116
private readonly string $cancelUrl;
118-
117+
119118
public function __construct(
120119
/**
121120
* @var Collection
@@ -125,10 +124,9 @@ public function __construct(
125124
private readonly Aliases $aliases,
126125
private readonly WebView $view,
127126
private readonly ResponseFactoryInterface $responseFactory
128-
)
129-
{
127+
) {
130128
}
131-
129+
132130
/**
133131
* @param string $url successful URL.
134132
*

src/AuthClientInterface.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ public function getTitle(): string;
2525
* @return array view options in format: optionName => optionValue
2626
*/
2727
public function getViewOptions(): array;
28-
28+
2929
public function getButtonClass(): string;
30-
30+
3131
/**
3232
* The Client id is publically visible in button urls
3333
* The Client secret must not be made available publically => exclude from interface
34-
*
34+
*
3535
* @return string
3636
*/
3737
public function getClientId(): string;
38-
38+
3939
public function buildAuthUrl(ServerRequestInterface $incomingRequest, array $params): string;
4040
}

src/Client/Facebook.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public function getCurrentUserJsonArray(OAuthToken $token): array
9494
}
9595
return [];
9696
}
97-
97+
9898
protected function initUserAttributes(): array
9999
{
100100
$token = $this->getAccessToken();
@@ -249,13 +249,13 @@ public function getName(): string
249249
public function getTitle(): string
250250
{
251251
return 'Facebook';
252-
}
253-
252+
}
253+
254254
#[\Override]
255255
public function getButtonClass(): string
256256
{
257257
return 'btn btn-primary bi bi-facebook';
258-
}
258+
}
259259

260260
/**
261261
* @return int[]

src/Client/GitHub.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public function getCurrentUserJsonArray(OAuthToken $token): array
7070

7171
return [];
7272
}
73-
73+
7474
protected function initUserAttributes(): array
7575
{
7676
$token = $this->getAccessToken();
@@ -91,13 +91,13 @@ public function getTitle(): string
9191
{
9292
return 'GitHub';
9393
}
94-
94+
9595
#[\Override]
9696
public function getButtonClass(): string
9797
{
9898
return 'btn btn-primary bi bi-github';
99-
}
100-
99+
}
100+
101101
/**
102102
* @return int[]
103103
*

src/Client/Google.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function getCurrentUserJsonArray(OAuthToken $token): array
7878

7979
return [];
8080
}
81-
81+
8282
protected function initUserAttributes(): array
8383
{
8484
$token = $this->getAccessToken();
@@ -99,13 +99,13 @@ public function getTitle(): string
9999
{
100100
return 'Google';
101101
}
102-
102+
103103
#[\Override]
104104
public function getButtonClass(): string
105105
{
106106
return 'btn btn-primary bi bi-google';
107-
}
108-
107+
}
108+
109109
/**
110110
* @return int[]
111111
*

src/Client/LinkedIn.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function getCurrentUserJsonArray(
6565

6666
return [];
6767
}
68-
68+
6969
protected function initUserAttributes(): array
7070
{
7171
$token = $this->getAccessToken();
@@ -75,7 +75,7 @@ protected function initUserAttributes(): array
7575
}
7676
return [];
7777
}
78-
78+
7979
#[\Override]
8080
public function getName(): string
8181
{
@@ -86,14 +86,14 @@ public function getName(): string
8686
public function getTitle(): string
8787
{
8888
return 'LinkedIn';
89-
}
90-
89+
}
90+
9191
#[\Override]
9292
public function getButtonClass(): string
9393
{
9494
return 'btn btn-info bi bi-linkedin';
95-
}
96-
95+
}
96+
9797
/**
9898
* @return int[]
9999
*

src/Client/MicrosoftOnline.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public function getCurrentUserJsonArray(
109109

110110
return [];
111111
}
112-
112+
113113
protected function initUserAttributes(): array
114114
{
115115
$token = $this->getAccessToken();
@@ -119,7 +119,7 @@ protected function initUserAttributes(): array
119119
}
120120
return [];
121121
}
122-
122+
123123
#[\Override]
124124
public function getName(): string
125125
{
@@ -131,13 +131,13 @@ public function getTitle(): string
131131
{
132132
return 'MicrosoftOnline';
133133
}
134-
134+
135135
#[\Override]
136136
public function getButtonClass(): string
137137
{
138138
return 'btn btn-warning bi bi-microsoft';
139-
}
140-
139+
}
140+
141141
/**
142142
* @return int[]
143143
*

src/Client/OpenIdConnect.php

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -41,23 +41,23 @@
4141
* @link https://github.com/web-token/jwt-framework
4242
*
4343
* @link https://openid.net/connect/
44-
*
45-
* e.g.'s: https://{IdentityProviderDomain}/.well-known/openid-configuration
46-
*
44+
*
45+
* e.g.'s: https://{IdentityProviderDomain}/.well-known/openid-configuration
46+
*
4747
* https://accounts.google.com/.well-known/openid-configuration
4848
* https://login.microsoftonline.com/{tenant}/v2.0/.well-known/openid-configuration
49-
* https://oidc.account.gov.uk/.well-known/openid-configuration
49+
* https://oidc.account.gov.uk/.well-known/openid-configuration
5050
* https://dev-kzv8xwxr.us.auth0.com/.well-known/openid-configuration
51-
*
51+
*
5252
* @see OAuth2
5353
*/
5454
final class OpenIdConnect extends OAuth2
5555
{
5656
protected string $authUrl = '';
57-
57+
5858
protected ?string $scope = 'openid';
5959
/**
60-
* @var string OpenID Issuer
60+
* @var string OpenID Issuer
6161
*/
6262
private string $issuerUrl = 'https://{IdentityProviderDomain}';
6363
/**
@@ -119,11 +119,11 @@ final class OpenIdConnect extends OAuth2
119119

120120
/**
121121
* OpenIdConnect constructor.
122-
*
122+
*
123123
* @param ClientInterface $httpClient
124124
* @param RequestFactoryInterface $requestFactory
125125
* @param StateStorageInterface $stateStorage
126-
* @param Factory $factory
126+
* @param Factory $factory
127127
* @param SessionInterface $session
128128
* @param string $name
129129
* @param string $title
@@ -132,9 +132,9 @@ public function __construct(
132132
ClientInterface $httpClient,
133133
RequestFactoryInterface $requestFactory,
134134
StateStorageInterface $stateStorage,
135-
Factory $factory,
136-
SessionInterface $session,
137-
CacheInterface $cache,
135+
Factory $factory,
136+
SessionInterface $session,
137+
CacheInterface $cache,
138138
string $name,
139139
string $title,
140140
) {
@@ -290,18 +290,18 @@ public function refreshAccessToken(OAuthToken $token): OAuthToken
290290
}
291291
return parent::refreshAccessToken($token);
292292
}
293-
293+
294294
#[\Override]
295295
public function getName(): string
296296
{
297297
/**
298-
* Note 1: Change OpenIdConnect::class to OAuth, Google,
298+
* Note 1: Change OpenIdConnect::class to OAuth, Google,
299299
* Note 2: Keep 'oidc' unchanged
300300
* Related logic: app's config/web/di/yii-auth-client
301301
* `@var array $paramsClients['oidc']`
302302
* `$openidconnectClient = $paramsClients['oidc'];`
303-
*
304-
* Related logic: app's config/common/params [yiisoft/yii-auth-client] =>
303+
*
304+
* Related logic: app's config/common/params [yiisoft/yii-auth-client] =>
305305
* [
306306
* 'oidc' => [
307307
* 'class' => 'Yiisoft\Yii\AuthClient\Client\OpenIdConnect::class',
@@ -319,13 +319,13 @@ public function getTitle(): string
319319
{
320320
return 'Open Id Connect';
321321
}
322-
322+
323323
#[\Override]
324324
public function getButtonClass(): string
325325
{
326326
return '';
327-
}
328-
327+
}
328+
329329
/**
330330
* @return int[]
331331
*

0 commit comments

Comments
 (0)