diff --git a/src/Auth.php b/src/Auth.php index 1e6923102..2fe5f87ca 100644 --- a/src/Auth.php +++ b/src/Auth.php @@ -177,7 +177,7 @@ public function getProvider(): UserModel * own, additional, features on top of the required ones, * like "remember-me" functionality. * - * @param string[] $args + * @param list $args * * @throws AuthenticationException */ diff --git a/src/Authentication/Authenticators/Session.php b/src/Authentication/Authenticators/Session.php index fd116cbbc..6712f8070 100644 --- a/src/Authentication/Authenticators/Session.php +++ b/src/Authentication/Authenticators/Session.php @@ -501,7 +501,7 @@ private function setAuthAction(): bool /** * Gets identities for action * - * @return UserIdentity[] + * @return list */ private function getIdentitiesForAction(User $user): array { @@ -512,7 +512,7 @@ private function getIdentitiesForAction(User $user): array } /** - * @return string[] + * @return list */ private function getActionTypes(): array { diff --git a/src/Authentication/JWT/JWSAdapterInterface.php b/src/Authentication/JWT/JWSAdapterInterface.php index 7305a018f..d497d1861 100644 --- a/src/Authentication/JWT/JWSAdapterInterface.php +++ b/src/Authentication/JWT/JWSAdapterInterface.php @@ -20,7 +20,7 @@ interface JWSAdapterInterface /** * Issues Signed JWT (JWS) * - * @param array $payload The payload. + * @param array $payload The payload. * @param string $keyset The key group. * The array key of Config\AuthJWT::$keys. * @param array|null $headers An array with header elements to attach. diff --git a/src/Authentication/Traits/HasAccessTokens.php b/src/Authentication/Traits/HasAccessTokens.php index f2fd7e283..02027ef27 100644 --- a/src/Authentication/Traits/HasAccessTokens.php +++ b/src/Authentication/Traits/HasAccessTokens.php @@ -34,8 +34,8 @@ trait HasAccessTokens /** * Generates a new personal access token for this user. * - * @param string $name Token name - * @param string[] $scopes Permissions the token grants + * @param string $name Token name + * @param list $scopes Permissions the token grants */ public function generateAccessToken(string $name, array $scopes = ['*']): AccessToken { @@ -81,7 +81,7 @@ public function revokeAllAccessTokens(): void /** * Retrieves all personal access tokens for this user. * - * @return AccessToken[] + * @return list */ public function accessTokens(): array { diff --git a/src/Authentication/Traits/HasHmacTokens.php b/src/Authentication/Traits/HasHmacTokens.php index a9db79303..bfaab7d65 100644 --- a/src/Authentication/Traits/HasHmacTokens.php +++ b/src/Authentication/Traits/HasHmacTokens.php @@ -35,8 +35,8 @@ trait HasHmacTokens /** * Generates a new personal HMAC token for this user. * - * @param string $name Token name - * @param string[] $scopes Permissions the token grants + * @param string $name Token name + * @param list $scopes Permissions the token grants * * @throws ReflectionException */ @@ -73,7 +73,7 @@ public function revokeAllHmacTokens(): void /** * Retrieves all personal HMAC tokens for this user. * - * @return AccessToken[] + * @return list */ public function hmacTokens(): array { diff --git a/src/Authorization/Traits/Authorizable.php b/src/Authorization/Traits/Authorizable.php index e26e1a772..ee4999a12 100644 --- a/src/Authorization/Traits/Authorizable.php +++ b/src/Authorization/Traits/Authorizable.php @@ -399,7 +399,7 @@ private function saveGroupsOrPermissions(string $type, $model, array $cache): vo } /** - * @return string[] + * @return list */ private function getConfigGroups(): array { @@ -407,7 +407,7 @@ private function getConfigGroups(): array } /** - * @return string[] + * @return list */ private function getConfigPermissions(): array { diff --git a/src/Config/Auth.php b/src/Config/Auth.php index bf4c9ca02..194631726 100644 --- a/src/Config/Auth.php +++ b/src/Config/Auth.php @@ -137,8 +137,7 @@ class Auth extends BaseConfig * when using the 'chain' filter. Each Authenticator listed will be checked. * If no match is found, then the next in the chain will be checked. * - * @var string[] - * @phpstan-var list + * @var list */ public array $authenticationChain = [ 'session', @@ -264,7 +263,7 @@ class Auth extends BaseConfig * You can add custom classes as long as they adhere to the * CodeIgniter\Shield\Authentication\Passwords\ValidatorInterface. * - * @var class-string[] + * @var list> */ public array $passwordValidators = [ CompositionValidator::class, diff --git a/src/Config/AuthJWT.php b/src/Config/AuthJWT.php index 2db352f93..b0ca11e8a 100644 --- a/src/Config/AuthJWT.php +++ b/src/Config/AuthJWT.php @@ -49,7 +49,7 @@ class AuthJWT extends BaseConfig * The key of the array is the key group name. * The first key of the group is used for signing. * - * @var array>> + * @var array>> * @phpstan-var array>> */ public array $keys = [ diff --git a/src/Controllers/ActionController.php b/src/Controllers/ActionController.php index 706dfcba7..73e356786 100644 --- a/src/Controllers/ActionController.php +++ b/src/Controllers/ActionController.php @@ -31,7 +31,7 @@ class ActionController extends BaseController /** * Perform an initial check if we have a valid action or not. * - * @param string[] $params + * @param list $params * * @return Response|string */ diff --git a/src/Controllers/LoginController.php b/src/Controllers/LoginController.php index a4c63d716..8c07f8b75 100644 --- a/src/Controllers/LoginController.php +++ b/src/Controllers/LoginController.php @@ -84,8 +84,7 @@ public function loginAction(): RedirectResponse /** * Returns the rules that should be used for validation. * - * @return array|string>> - * @phpstan-return array>> + * @return array|string>> */ protected function getValidationRules(): array { diff --git a/src/Controllers/MagicLinkController.php b/src/Controllers/MagicLinkController.php index 78fb74785..1558c6843 100644 --- a/src/Controllers/MagicLinkController.php +++ b/src/Controllers/MagicLinkController.php @@ -241,8 +241,7 @@ private function recordLoginAttempt( /** * Returns the rules that should be used for validation. * - * @return array|string>> - * @phpstan-return array>> + * @return array|string>> */ protected function getValidationRules(): array { diff --git a/src/Controllers/RegisterController.php b/src/Controllers/RegisterController.php index 133388b2a..7b310b1f8 100644 --- a/src/Controllers/RegisterController.php +++ b/src/Controllers/RegisterController.php @@ -169,8 +169,7 @@ protected function getUserEntity(): User /** * Returns the rules that should be used for validation. * - * @return array|string>> - * @phpstan-return array>> + * @return array|string>> */ protected function getValidationRules(): array { diff --git a/src/Entities/Entity.php b/src/Entities/Entity.php index 550945049..f07416fdd 100644 --- a/src/Entities/Entity.php +++ b/src/Entities/Entity.php @@ -24,7 +24,7 @@ abstract class Entity extends FrameworkEntity /** * Custom convert handlers * - * @var array + * @var array * @phpstan-var array */ protected $castHandlers = [ diff --git a/src/Entities/User.php b/src/Entities/User.php index 573e9e987..c6c686575 100644 --- a/src/Entities/User.php +++ b/src/Entities/User.php @@ -26,13 +26,13 @@ use CodeIgniter\Shield\Traits\Resettable; /** - * @property string|null $email - * @property int|string|null $id - * @property UserIdentity[]|null $identities - * @property Time|null $last_active - * @property string|null $password - * @property string|null $password_hash - * @property string|null $username + * @property string|null $email + * @property int|string|null $id + * @property list|null $identities + * @property Time|null $last_active + * @property string|null $password + * @property string|null $password_hash + * @property string|null $username */ class User extends Entity { @@ -44,7 +44,7 @@ class User extends Entity use Bannable; /** - * @var UserIdentity[]|null + * @var list|null */ private ?array $identities = null; @@ -53,9 +53,7 @@ class User extends Entity private ?string $password_hash = null; /** - * @var string[] - * @phpstan-var list - * @psalm-var list + * @var list */ protected $dates = [ 'created_at', @@ -107,7 +105,7 @@ private function populateIdentities(): void * * @param string $type 'all' returns all identities. * - * @return UserIdentity[] + * @return list */ public function getIdentities(string $type = 'all'): array { diff --git a/src/Entities/UserIdentity.php b/src/Entities/UserIdentity.php index b0a491fe9..eed3f87db 100644 --- a/src/Entities/UserIdentity.php +++ b/src/Entities/UserIdentity.php @@ -45,9 +45,7 @@ class UserIdentity extends Entity ]; /** - * @var string[] - * @phpstan-var list - * @psalm-var list + * @var list */ protected $dates = [ 'expires', diff --git a/src/Models/UserIdentityModel.php b/src/Models/UserIdentityModel.php index 2f437154b..d65a1810b 100644 --- a/src/Models/UserIdentityModel.php +++ b/src/Models/UserIdentityModel.php @@ -144,8 +144,8 @@ public function createCodeIdentity( /** * Generates a new personal access token for the user. * - * @param string $name Token name - * @param string[] $scopes Permissions the token grants + * @param string $name Token name + * @param list $scopes Permissions the token grants */ public function generateAccessToken(User $user, string $name, array $scopes = ['*']): AccessToken { @@ -210,7 +210,7 @@ public function getAccessTokenById($id, User $user): ?AccessToken } /** - * @return AccessToken[] + * @return list */ public function getAllAccessTokens(User $user): array { @@ -242,8 +242,8 @@ public function getHmacTokenByKey(string $key): ?AccessToken /** * Generates a new personal access token for the user. * - * @param string $name Token name - * @param string[] $scopes Permissions the token grants + * @param string $name Token name + * @param list $scopes Permissions the token grants * * @throws Exception * @throws ReflectionException @@ -321,7 +321,7 @@ public function getHmacTokenById($id, User $user): ?AccessToken * * @param User $user User object * - * @return AccessToken[] + * @return list */ public function getAllHmacTokens(User $user): array { @@ -384,7 +384,7 @@ public function getIdentityBySecret(string $type, ?string $secret): ?UserIdentit /** * Returns all identities. * - * @return UserIdentity[] + * @return list */ public function getIdentities(User $user): array { @@ -394,9 +394,9 @@ public function getIdentities(User $user): array } /** - * @param int[]|string[] $userIds + * @param list|list $userIds * - * @return UserIdentity[] + * @return list */ public function getIdentitiesByUserIds(array $userIds): array { @@ -419,9 +419,9 @@ public function getIdentityByType(User $user, string $type): ?UserIdentity /** * Returns all identities for the specific types. * - * @param string[] $types + * @param list $types * - * @return UserIdentity[] + * @return list */ public function getIdentitiesByTypes(User $user, array $types): array { @@ -507,7 +507,7 @@ public function revokeAllAccessTokens(User $user): void /** * Force password reset for multiple users. * - * @param int[]|string[] $userIds + * @param list|list $userIds */ public function forceMultiplePasswordReset(array $userIds): void { diff --git a/src/Models/UserModel.php b/src/Models/UserModel.php index df991b1b5..8a9b1c620 100644 --- a/src/Models/UserModel.php +++ b/src/Models/UserModel.php @@ -113,10 +113,10 @@ protected function fetchIdentities(array $data): array /** * Map our users by ID to make assigning simpler * - * @param array $data Event $data - * @param UserIdentity[] $identities + * @param array $data Event $data + * @param list $identities * - * @return User[] UserId => User object + * @return list UserId => User object * @phpstan-return array UserId => User object */ private function assignIdentities(array $data, array $identities): array diff --git a/tests/Authentication/HasAccessTokensTest.php b/tests/Authentication/HasAccessTokensTest.php index 0005325d8..f86668f1d 100644 --- a/tests/Authentication/HasAccessTokensTest.php +++ b/tests/Authentication/HasAccessTokensTest.php @@ -66,7 +66,7 @@ public function testAccessTokens(): void ['user_id' => $this->user->id, 'type' => 'access_token', 'secret' => 'secretToken2'] ); - /** @var AccessToken[] $tokens */ + /** @var list $tokens */ $tokens = $this->user->accessTokens(); $this->assertCount(2, $tokens); diff --git a/tests/Language/AbstractTranslationTestCase.php b/tests/Language/AbstractTranslationTestCase.php index 63b64eea1..4134dd61e 100644 --- a/tests/Language/AbstractTranslationTestCase.php +++ b/tests/Language/AbstractTranslationTestCase.php @@ -89,8 +89,7 @@ abstract class AbstractTranslationTestCase extends TestCase * class and the contained values will be skipped in * testAllIncludedLanguageKeysAreTranslated. * - * @var string[] - * @phpstan-var list + * @var list */ protected array $excludedLocaleKeyTranslations = []; @@ -360,7 +359,7 @@ final public function testAllLocalizationParametersAreNotTranslated(string $loca } /** - * @return string[][] + * @return array> */ final public static function localesProvider(): iterable { @@ -393,7 +392,7 @@ final public function testLocaleHasCorrespondingTestCaseFile(string $locale): vo /** * Get all the ISO 639-1 and 639-2 locale codes. * - * @return array> + * @return array> */ final public function translationKeys(): array {