Skip to content

Commit 933da42

Browse files
authored
Merge pull request #1051 from kenjis/docs-update-phpdoc-array
docs: update PHPDoc array types
2 parents 904e3d1 + f282bae commit 933da42

19 files changed

+50
-59
lines changed

src/Auth.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ public function getProvider(): UserModel
177177
* own, additional, features on top of the required ones,
178178
* like "remember-me" functionality.
179179
*
180-
* @param string[] $args
180+
* @param list<string> $args
181181
*
182182
* @throws AuthenticationException
183183
*/

src/Authentication/Authenticators/Session.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ private function setAuthAction(): bool
501501
/**
502502
* Gets identities for action
503503
*
504-
* @return UserIdentity[]
504+
* @return list<UserIdentity>
505505
*/
506506
private function getIdentitiesForAction(User $user): array
507507
{
@@ -512,7 +512,7 @@ private function getIdentitiesForAction(User $user): array
512512
}
513513

514514
/**
515-
* @return string[]
515+
* @return list<string>
516516
*/
517517
private function getActionTypes(): array
518518
{

src/Authentication/JWT/JWSAdapterInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ interface JWSAdapterInterface
2020
/**
2121
* Issues Signed JWT (JWS)
2222
*
23-
* @param array<mixed> $payload The payload.
23+
* @param array<string, mixed> $payload The payload.
2424
* @param string $keyset The key group.
2525
* The array key of Config\AuthJWT::$keys.
2626
* @param array<string, string>|null $headers An array with header elements to attach.

src/Authentication/Traits/HasAccessTokens.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ trait HasAccessTokens
3434
/**
3535
* Generates a new personal access token for this user.
3636
*
37-
* @param string $name Token name
38-
* @param string[] $scopes Permissions the token grants
37+
* @param string $name Token name
38+
* @param list<string> $scopes Permissions the token grants
3939
*/
4040
public function generateAccessToken(string $name, array $scopes = ['*']): AccessToken
4141
{
@@ -81,7 +81,7 @@ public function revokeAllAccessTokens(): void
8181
/**
8282
* Retrieves all personal access tokens for this user.
8383
*
84-
* @return AccessToken[]
84+
* @return list<AccessToken>
8585
*/
8686
public function accessTokens(): array
8787
{

src/Authentication/Traits/HasHmacTokens.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ trait HasHmacTokens
3535
/**
3636
* Generates a new personal HMAC token for this user.
3737
*
38-
* @param string $name Token name
39-
* @param string[] $scopes Permissions the token grants
38+
* @param string $name Token name
39+
* @param list<string> $scopes Permissions the token grants
4040
*
4141
* @throws ReflectionException
4242
*/
@@ -73,7 +73,7 @@ public function revokeAllHmacTokens(): void
7373
/**
7474
* Retrieves all personal HMAC tokens for this user.
7575
*
76-
* @return AccessToken[]
76+
* @return list<AccessToken>
7777
*/
7878
public function hmacTokens(): array
7979
{

src/Authorization/Traits/Authorizable.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,15 +399,15 @@ private function saveGroupsOrPermissions(string $type, $model, array $cache): vo
399399
}
400400

401401
/**
402-
* @return string[]
402+
* @return list<string>
403403
*/
404404
private function getConfigGroups(): array
405405
{
406406
return array_keys(setting('AuthGroups.groups'));
407407
}
408408

409409
/**
410-
* @return string[]
410+
* @return list<string>
411411
*/
412412
private function getConfigPermissions(): array
413413
{

src/Config/Auth.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,7 @@ class Auth extends BaseConfig
137137
* when using the 'chain' filter. Each Authenticator listed will be checked.
138138
* If no match is found, then the next in the chain will be checked.
139139
*
140-
* @var string[]
141-
* @phpstan-var list<string>
140+
* @var list<string>
142141
*/
143142
public array $authenticationChain = [
144143
'session',
@@ -264,7 +263,7 @@ class Auth extends BaseConfig
264263
* You can add custom classes as long as they adhere to the
265264
* CodeIgniter\Shield\Authentication\Passwords\ValidatorInterface.
266265
*
267-
* @var class-string<ValidatorInterface>[]
266+
* @var list<class-string<ValidatorInterface>>
268267
*/
269268
public array $passwordValidators = [
270269
CompositionValidator::class,

src/Config/AuthJWT.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class AuthJWT extends BaseConfig
4949
* The key of the array is the key group name.
5050
* The first key of the group is used for signing.
5151
*
52-
* @var array<string, array<int, array<string, string>>>
52+
* @var array<string, array<int, array<string, string>>>
5353
* @phpstan-var array<string, list<array<string, string>>>
5454
*/
5555
public array $keys = [

src/Controllers/ActionController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class ActionController extends BaseController
3131
/**
3232
* Perform an initial check if we have a valid action or not.
3333
*
34-
* @param string[] $params
34+
* @param list<string> $params
3535
*
3636
* @return Response|string
3737
*/

src/Controllers/LoginController.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,7 @@ public function loginAction(): RedirectResponse
8484
/**
8585
* Returns the rules that should be used for validation.
8686
*
87-
* @return array<string, array<string, array<string>|string>>
88-
* @phpstan-return array<string, array<string, string|list<string>>>
87+
* @return array<string, array<string, list<string>|string>>
8988
*/
9089
protected function getValidationRules(): array
9190
{

0 commit comments

Comments
 (0)