diff --git a/phpstan-baseline.php b/phpstan-baseline.php index de7baa6ea..4e6623cc7 100644 --- a/phpstan-baseline.php +++ b/phpstan-baseline.php @@ -2,523 +2,517 @@ $ignoreErrors = []; $ignoreErrors[] = [ - 'message' => '#^Call to deprecated function random_string\\(\\)\\: -The type \'basic\', \'md5\', and \'sha1\' are deprecated\\. They are not cryptographically secure\\.$#', + 'rawMessage' => 'Call to deprecated function random_string(): +The type \'basic\', \'md5\', and \'sha1\' are deprecated. They are not cryptographically secure.', 'identifier' => 'function.deprecated', 'count' => 1, 'path' => __DIR__ . '/src/Authentication/Actions/Email2FA.php', ]; $ignoreErrors[] = [ - 'message' => '#^Call to function model with CodeIgniter\\\\Shield\\\\Models\\\\UserIdentityModel\\:\\:class is discouraged\\.$#', + 'rawMessage' => 'Call to function model with CodeIgniter\\Shield\\Models\\UserIdentityModel::class is discouraged.', 'identifier' => 'codeigniter.factoriesClassConstFetch', 'count' => 2, 'path' => __DIR__ . '/src/Authentication/Actions/Email2FA.php', ]; $ignoreErrors[] = [ - 'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#', + 'rawMessage' => 'Construct empty() is not allowed. Use more strict comparison.', 'identifier' => 'empty.notAllowed', 'count' => 1, 'path' => __DIR__ . '/src/Authentication/Actions/Email2FA.php', ]; $ignoreErrors[] = [ - 'message' => '#^Call to deprecated function random_string\\(\\)\\: -The type \'basic\', \'md5\', and \'sha1\' are deprecated\\. They are not cryptographically secure\\.$#', + 'rawMessage' => 'Call to deprecated function random_string(): +The type \'basic\', \'md5\', and \'sha1\' are deprecated. They are not cryptographically secure.', 'identifier' => 'function.deprecated', 'count' => 1, 'path' => __DIR__ . '/src/Authentication/Actions/EmailActivator.php', ]; $ignoreErrors[] = [ - 'message' => '#^Call to function model with CodeIgniter\\\\Shield\\\\Models\\\\UserIdentityModel\\:\\:class is discouraged\\.$#', + 'rawMessage' => 'Call to function model with CodeIgniter\\Shield\\Models\\UserIdentityModel::class is discouraged.', 'identifier' => 'codeigniter.factoriesClassConstFetch', 'count' => 2, 'path' => __DIR__ . '/src/Authentication/Actions/EmailActivator.php', ]; $ignoreErrors[] = [ - 'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#', + 'rawMessage' => 'Construct empty() is not allowed. Use more strict comparison.', 'identifier' => 'empty.notAllowed', 'count' => 1, 'path' => __DIR__ . '/src/Authentication/Authentication.php', ]; $ignoreErrors[] = [ - 'message' => '#^Call to function model with CodeIgniter\\\\Shield\\\\Models\\\\TokenLoginModel\\:\\:class is discouraged\\.$#', + 'rawMessage' => 'Call to function model with CodeIgniter\\Shield\\Models\\TokenLoginModel::class is discouraged.', 'identifier' => 'codeigniter.factoriesClassConstFetch', 'count' => 1, 'path' => __DIR__ . '/src/Authentication/Authenticators/AccessTokens.php', ]; $ignoreErrors[] = [ - 'message' => '#^Call to function model with CodeIgniter\\\\Shield\\\\Models\\\\UserIdentityModel\\:\\:class is discouraged\\.$#', + 'rawMessage' => 'Call to function model with CodeIgniter\\Shield\\Models\\UserIdentityModel::class is discouraged.', 'identifier' => 'codeigniter.factoriesClassConstFetch', 'count' => 1, 'path' => __DIR__ . '/src/Authentication/Authenticators/AccessTokens.php', ]; $ignoreErrors[] = [ - 'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#', + 'rawMessage' => 'Construct empty() is not allowed. Use more strict comparison.', 'identifier' => 'empty.notAllowed', 'count' => 2, 'path' => __DIR__ . '/src/Authentication/Authenticators/AccessTokens.php', ]; $ignoreErrors[] = [ - 'message' => '#^Only booleans are allowed in &&, CodeIgniter\\\\I18n\\\\Time\\|null given on the left side\\.$#', + 'rawMessage' => 'Only booleans are allowed in &&, CodeIgniter\\I18n\\Time|null given on the left side.', 'identifier' => 'booleanAnd.leftNotBoolean', 'count' => 1, 'path' => __DIR__ . '/src/Authentication/Authenticators/AccessTokens.php', ]; $ignoreErrors[] = [ - 'message' => '#^Call to function model with CodeIgniter\\\\Shield\\\\Models\\\\TokenLoginModel\\:\\:class is discouraged\\.$#', + 'rawMessage' => 'Call to function model with CodeIgniter\\Shield\\Models\\TokenLoginModel::class is discouraged.', 'identifier' => 'codeigniter.factoriesClassConstFetch', 'count' => 1, 'path' => __DIR__ . '/src/Authentication/Authenticators/HmacSha256.php', ]; $ignoreErrors[] = [ - 'message' => '#^Call to function model with CodeIgniter\\\\Shield\\\\Models\\\\UserIdentityModel\\:\\:class is discouraged\\.$#', + 'rawMessage' => 'Call to function model with CodeIgniter\\Shield\\Models\\UserIdentityModel::class is discouraged.', 'identifier' => 'codeigniter.factoriesClassConstFetch', 'count' => 1, 'path' => __DIR__ . '/src/Authentication/Authenticators/HmacSha256.php', ]; $ignoreErrors[] = [ - 'message' => '#^Call to function model with CodeIgniter\\\\Shield\\\\Models\\\\TokenLoginModel\\:\\:class is discouraged\\.$#', + 'rawMessage' => 'Call to function model with CodeIgniter\\Shield\\Models\\TokenLoginModel::class is discouraged.', 'identifier' => 'codeigniter.factoriesClassConstFetch', 'count' => 1, 'path' => __DIR__ . '/src/Authentication/Authenticators/JWT.php', ]; $ignoreErrors[] = [ - 'message' => '#^Parameter \\#1 \\$credentials \\(array\\{token\\?\\: string\\}\\) of method CodeIgniter\\\\Shield\\\\Authentication\\\\Authenticators\\\\JWT\\:\\:attempt\\(\\) should be contravariant with parameter \\$credentials \\(array\\) of method CodeIgniter\\\\Shield\\\\Authentication\\\\AuthenticatorInterface\\:\\:attempt\\(\\)$#', + 'rawMessage' => 'Parameter #1 $credentials (array{token?: string}) of method CodeIgniter\\Shield\\Authentication\\Authenticators\\JWT::attempt() should be contravariant with parameter $credentials (array) of method CodeIgniter\\Shield\\Authentication\\AuthenticatorInterface::attempt()', 'identifier' => 'method.childParameterType', 'count' => 1, 'path' => __DIR__ . '/src/Authentication/Authenticators/JWT.php', ]; $ignoreErrors[] = [ - 'message' => '#^Parameter \\#1 \\$credentials \\(array\\{token\\?\\: string\\}\\) of method CodeIgniter\\\\Shield\\\\Authentication\\\\Authenticators\\\\JWT\\:\\:check\\(\\) should be contravariant with parameter \\$credentials \\(array\\) of method CodeIgniter\\\\Shield\\\\Authentication\\\\AuthenticatorInterface\\:\\:check\\(\\)$#', + 'rawMessage' => 'Parameter #1 $credentials (array{token?: string}) of method CodeIgniter\\Shield\\Authentication\\Authenticators\\JWT::check() should be contravariant with parameter $credentials (array) of method CodeIgniter\\Shield\\Authentication\\AuthenticatorInterface::check()', 'identifier' => 'method.childParameterType', 'count' => 1, 'path' => __DIR__ . '/src/Authentication/Authenticators/JWT.php', ]; $ignoreErrors[] = [ - 'message' => '#^Call to function model with CodeIgniter\\\\Shield\\\\Models\\\\LoginModel\\:\\:class is discouraged\\.$#', + 'rawMessage' => 'Call to function model with CodeIgniter\\Shield\\Models\\LoginModel::class is discouraged.', 'identifier' => 'codeigniter.factoriesClassConstFetch', 'count' => 1, 'path' => __DIR__ . '/src/Authentication/Authenticators/Session.php', ]; $ignoreErrors[] = [ - 'message' => '#^Call to function model with CodeIgniter\\\\Shield\\\\Models\\\\RememberModel\\:\\:class is discouraged\\.$#', + 'rawMessage' => 'Call to function model with CodeIgniter\\Shield\\Models\\RememberModel::class is discouraged.', 'identifier' => 'codeigniter.factoriesClassConstFetch', 'count' => 1, 'path' => __DIR__ . '/src/Authentication/Authenticators/Session.php', ]; $ignoreErrors[] = [ - 'message' => '#^Call to function model with CodeIgniter\\\\Shield\\\\Models\\\\UserIdentityModel\\:\\:class is discouraged\\.$#', + 'rawMessage' => 'Call to function model with CodeIgniter\\Shield\\Models\\UserIdentityModel::class is discouraged.', 'identifier' => 'codeigniter.factoriesClassConstFetch', 'count' => 1, 'path' => __DIR__ . '/src/Authentication/Authenticators/Session.php', ]; $ignoreErrors[] = [ - 'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#', + 'rawMessage' => 'Construct empty() is not allowed. Use more strict comparison.', 'identifier' => 'empty.notAllowed', 'count' => 1, 'path' => __DIR__ . '/src/Authentication/Authenticators/Session.php', ]; $ignoreErrors[] = [ - 'message' => '#^Only booleans are allowed in an if condition, int\\|string\\|null given\\.$#', + 'rawMessage' => 'Only booleans are allowed in an if condition, int|string|null given.', 'identifier' => 'if.condNotBoolean', 'count' => 3, 'path' => __DIR__ . '/src/Authentication/Authenticators/Session.php', ]; $ignoreErrors[] = [ - 'message' => '#^Parameter \\#1 \\$credentials \\(array\\{email\\?\\: string, username\\?\\: string, password\\?\\: string\\}\\) of method CodeIgniter\\\\Shield\\\\Authentication\\\\Authenticators\\\\Session\\:\\:attempt\\(\\) should be contravariant with parameter \\$credentials \\(array\\) of method CodeIgniter\\\\Shield\\\\Authentication\\\\AuthenticatorInterface\\:\\:attempt\\(\\)$#', + 'rawMessage' => 'Parameter #1 $credentials (array{email?: string, username?: string, password?: string}) of method CodeIgniter\\Shield\\Authentication\\Authenticators\\Session::attempt() should be contravariant with parameter $credentials (array) of method CodeIgniter\\Shield\\Authentication\\AuthenticatorInterface::attempt()', 'identifier' => 'method.childParameterType', 'count' => 1, 'path' => __DIR__ . '/src/Authentication/Authenticators/Session.php', ]; $ignoreErrors[] = [ - 'message' => '#^Parameter \\#1 \\$credentials \\(array\\{email\\?\\: string, username\\?\\: string, password\\?\\: string\\}\\) of method CodeIgniter\\\\Shield\\\\Authentication\\\\Authenticators\\\\Session\\:\\:check\\(\\) should be contravariant with parameter \\$credentials \\(array\\) of method CodeIgniter\\\\Shield\\\\Authentication\\\\AuthenticatorInterface\\:\\:check\\(\\)$#', + 'rawMessage' => 'Parameter #1 $credentials (array{email?: string, username?: string, password?: string}) of method CodeIgniter\\Shield\\Authentication\\Authenticators\\Session::check() should be contravariant with parameter $credentials (array) of method CodeIgniter\\Shield\\Authentication\\AuthenticatorInterface::check()', 'identifier' => 'method.childParameterType', 'count' => 1, 'path' => __DIR__ . '/src/Authentication/Authenticators/Session.php', ]; $ignoreErrors[] = [ - 'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#', + 'rawMessage' => 'Construct empty() is not allowed. Use more strict comparison.', 'identifier' => 'empty.notAllowed', 'count' => 4, 'path' => __DIR__ . '/src/Authentication/Passwords/NothingPersonalValidator.php', ]; $ignoreErrors[] = [ - 'message' => '#^PHPDoc tag @var with type string is not subtype of type uppercase\\-string\\.$#', + 'rawMessage' => 'PHPDoc tag @var with type string is not subtype of type uppercase-string.', 'identifier' => 'varTag.type', 'count' => 1, 'path' => __DIR__ . '/src/Authentication/Passwords/PwnedValidator.php', ]; $ignoreErrors[] = [ - 'message' => '#^Only booleans are allowed in &&, CodeIgniter\\\\Shield\\\\Entities\\\\User\\|null given on the right side\\.$#', + 'rawMessage' => 'Only booleans are allowed in &&, CodeIgniter\\Shield\\Entities\\User|null given on the right side.', 'identifier' => 'booleanAnd.rightNotBoolean', 'count' => 1, 'path' => __DIR__ . '/src/Authentication/Passwords/ValidationRules.php', ]; $ignoreErrors[] = [ - 'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#', + 'rawMessage' => 'Construct empty() is not allowed. Use more strict comparison.', 'identifier' => 'empty.notAllowed', 'count' => 3, 'path' => __DIR__ . '/src/Authorization/Groups.php', ]; $ignoreErrors[] = [ - 'message' => '#^Return type \\(int\\|string\\|null\\) of method CodeIgniter\\\\Shield\\\\Collectors\\\\Auth\\:\\:getBadgeValue\\(\\) should be covariant with return type \\(int\\|null\\) of method CodeIgniter\\\\Debug\\\\Toolbar\\\\Collectors\\\\BaseCollector\\:\\:getBadgeValue\\(\\)$#', + 'rawMessage' => 'Return type (int|string|null) of method CodeIgniter\\Shield\\Collectors\\Auth::getBadgeValue() should be covariant with return type (int|null) of method CodeIgniter\\Debug\\Toolbar\\Collectors\\BaseCollector::getBadgeValue()', 'identifier' => 'method.childReturnType', 'count' => 1, 'path' => __DIR__ . '/src/Collectors/Auth.php', ]; $ignoreErrors[] = [ - 'message' => '#^Cannot access property \\$expires on array\\\\|object\\.$#', + 'rawMessage' => 'Cannot access property $expires on array|object.', 'identifier' => 'property.nonObject', 'count' => 3, 'path' => __DIR__ . '/src/Commands/Hmac.php', ]; $ignoreErrors[] = [ - 'message' => '#^Cannot access property \\$id on array\\\\|object\\.$#', + 'rawMessage' => 'Cannot access property $id on array|object.', 'identifier' => 'property.nonObject', 'count' => 9, 'path' => __DIR__ . '/src/Commands/Hmac.php', ]; $ignoreErrors[] = [ - 'message' => '#^Cannot access property \\$secret2 on array\\\\|object\\.$#', + 'rawMessage' => 'Cannot access property $secret2 on array|object.', 'identifier' => 'property.nonObject', 'count' => 11, 'path' => __DIR__ . '/src/Commands/Hmac.php', ]; $ignoreErrors[] = [ - 'message' => '#^Call to function model with CodeIgniter\\\\Shield\\\\Models\\\\GroupModel\\:\\:class is discouraged\\.$#', + 'rawMessage' => 'Call to function model with CodeIgniter\\Shield\\Models\\GroupModel::class is discouraged.', 'identifier' => 'codeigniter.factoriesClassConstFetch', 'count' => 1, 'path' => __DIR__ . '/src/Commands/User.php', ]; $ignoreErrors[] = [ - 'message' => '#^Call to function model with CodeIgniter\\\\Shield\\\\Models\\\\UserModel\\:\\:class is discouraged\\.$#', + 'rawMessage' => 'Call to function model with CodeIgniter\\Shield\\Models\\UserModel::class is discouraged.', 'identifier' => 'codeigniter.factoriesClassConstFetch', 'count' => 9, 'path' => __DIR__ . '/src/Commands/User.php', ]; $ignoreErrors[] = [ - 'message' => '#^Call to deprecated function random_string\\(\\)\\: -The type \'basic\', \'md5\', and \'sha1\' are deprecated\\. They are not cryptographically secure\\.$#', + 'rawMessage' => 'Call to deprecated function random_string(): +The type \'basic\', \'md5\', and \'sha1\' are deprecated. They are not cryptographically secure.', 'identifier' => 'function.deprecated', 'count' => 1, 'path' => __DIR__ . '/src/Controllers/MagicLinkController.php', ]; $ignoreErrors[] = [ - 'message' => '#^Call to function model with CodeIgniter\\\\Shield\\\\Models\\\\LoginModel\\:\\:class is discouraged\\.$#', + 'rawMessage' => 'Call to function model with CodeIgniter\\Shield\\Models\\LoginModel::class is discouraged.', 'identifier' => 'codeigniter.factoriesClassConstFetch', 'count' => 1, 'path' => __DIR__ . '/src/Controllers/MagicLinkController.php', ]; $ignoreErrors[] = [ - 'message' => '#^Call to function model with CodeIgniter\\\\Shield\\\\Models\\\\UserIdentityModel\\:\\:class is discouraged\\.$#', + 'rawMessage' => 'Call to function model with CodeIgniter\\Shield\\Models\\UserIdentityModel::class is discouraged.', 'identifier' => 'codeigniter.factoriesClassConstFetch', 'count' => 2, 'path' => __DIR__ . '/src/Controllers/MagicLinkController.php', ]; $ignoreErrors[] = [ - 'message' => '#^Call to function assert\\(\\) with false and \'Config Auth…\' will always evaluate to false\\.$#', + 'rawMessage' => 'Call to function assert() with false and \'Config Auth…\' will always evaluate to false.', 'identifier' => 'function.impossibleType', 'count' => 1, 'path' => __DIR__ . '/src/Controllers/RegisterController.php', ]; $ignoreErrors[] = [ - 'message' => '#^Instanceof between null and CodeIgniter\\\\Shield\\\\Models\\\\UserModel will always evaluate to false\\.$#', + 'rawMessage' => 'Instanceof between null and CodeIgniter\\Shield\\Models\\UserModel will always evaluate to false.', 'identifier' => 'instanceof.alwaysFalse', 'count' => 1, 'path' => __DIR__ . '/src/Controllers/RegisterController.php', ]; $ignoreErrors[] = [ - 'message' => '#^Parameter \\#1 \\$name of function model expects a valid class string, array\\|bool\\|float\\|int\\|object\\|string\\|null given\\.$#', + 'rawMessage' => 'Parameter #1 $name of function model expects a valid class string, array|bool|float|int|object|string|null given.', 'identifier' => 'codeigniter.modelArgumentType', 'count' => 1, 'path' => __DIR__ . '/src/Controllers/RegisterController.php', ]; $ignoreErrors[] = [ - 'message' => '#^Call to an undefined method CodeIgniter\\\\Database\\\\ConnectionInterface\\:\\:disableForeignKeyChecks\\(\\)\\.$#', + 'rawMessage' => 'Call to an undefined method CodeIgniter\\Database\\ConnectionInterface::disableForeignKeyChecks().', 'identifier' => 'method.notFound', 'count' => 1, 'path' => __DIR__ . '/src/Database/Migrations/2020-12-28-223112_create_auth_tables.php', ]; $ignoreErrors[] = [ - 'message' => '#^Call to an undefined method CodeIgniter\\\\Database\\\\ConnectionInterface\\:\\:enableForeignKeyChecks\\(\\)\\.$#', + 'rawMessage' => 'Call to an undefined method CodeIgniter\\Database\\ConnectionInterface::enableForeignKeyChecks().', 'identifier' => 'method.notFound', 'count' => 1, 'path' => __DIR__ . '/src/Database/Migrations/2020-12-28-223112_create_auth_tables.php', ]; $ignoreErrors[] = [ - 'message' => '#^Call to function model with CodeIgniter\\\\Shield\\\\Models\\\\GroupModel\\:\\:class is discouraged\\.$#', + 'rawMessage' => 'Call to function model with CodeIgniter\\Shield\\Models\\GroupModel::class is discouraged.', 'identifier' => 'codeigniter.factoriesClassConstFetch', 'count' => 4, 'path' => __DIR__ . '/src/Entities/User.php', ]; $ignoreErrors[] = [ - 'message' => '#^Call to function model with CodeIgniter\\\\Shield\\\\Models\\\\LoginModel\\:\\:class is discouraged\\.$#', + 'rawMessage' => 'Call to function model with CodeIgniter\\Shield\\Models\\LoginModel::class is discouraged.', 'identifier' => 'codeigniter.factoriesClassConstFetch', 'count' => 2, 'path' => __DIR__ . '/src/Entities/User.php', ]; $ignoreErrors[] = [ - 'message' => '#^Call to function model with CodeIgniter\\\\Shield\\\\Models\\\\PermissionModel\\:\\:class is discouraged\\.$#', + 'rawMessage' => 'Call to function model with CodeIgniter\\Shield\\Models\\PermissionModel::class is discouraged.', 'identifier' => 'codeigniter.factoriesClassConstFetch', 'count' => 2, 'path' => __DIR__ . '/src/Entities/User.php', ]; $ignoreErrors[] = [ - 'message' => '#^Call to function model with CodeIgniter\\\\Shield\\\\Models\\\\UserIdentityModel\\:\\:class is discouraged\\.$#', + 'rawMessage' => 'Call to function model with CodeIgniter\\Shield\\Models\\UserIdentityModel::class is discouraged.', 'identifier' => 'codeigniter.factoriesClassConstFetch', 'count' => 23, 'path' => __DIR__ . '/src/Entities/User.php', ]; $ignoreErrors[] = [ - 'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#', - 'identifier' => 'empty.notAllowed', - 'count' => 7, - 'path' => __DIR__ . '/src/Entities/User.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Only booleans are allowed in a ternary operator condition, int\\<0, max\\> given\\.$#', + 'rawMessage' => 'Only booleans are allowed in a ternary operator condition, int<0, max> given.', 'identifier' => 'ternary.condNotBoolean', 'count' => 1, 'path' => __DIR__ . '/src/Entities/User.php', ]; $ignoreErrors[] = [ - 'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#', + 'rawMessage' => 'Construct empty() is not allowed. Use more strict comparison.', 'identifier' => 'empty.notAllowed', 'count' => 1, 'path' => __DIR__ . '/src/Filters/AbstractAuthFilter.php', ]; $ignoreErrors[] = [ - 'message' => '#^Return type \\(CodeIgniter\\\\HTTP\\\\RedirectResponse\\|void\\) of method CodeIgniter\\\\Shield\\\\Filters\\\\AbstractAuthFilter\\:\\:before\\(\\) should be covariant with return type \\(CodeIgniter\\\\HTTP\\\\RequestInterface\\|CodeIgniter\\\\HTTP\\\\ResponseInterface\\|string\\|null\\) of method CodeIgniter\\\\Filters\\\\FilterInterface\\:\\:before\\(\\)$#', + 'rawMessage' => 'Return type (CodeIgniter\\HTTP\\RedirectResponse|void) of method CodeIgniter\\Shield\\Filters\\AbstractAuthFilter::before() should be covariant with return type (CodeIgniter\\HTTP\\RequestInterface|CodeIgniter\\HTTP\\ResponseInterface|string|null) of method CodeIgniter\\Filters\\FilterInterface::before()', 'identifier' => 'method.childReturnType', 'count' => 1, 'path' => __DIR__ . '/src/Filters/AbstractAuthFilter.php', ]; $ignoreErrors[] = [ - 'message' => '#^Return type \\(void\\) of method CodeIgniter\\\\Shield\\\\Filters\\\\AbstractAuthFilter\\:\\:after\\(\\) should be compatible with return type \\(CodeIgniter\\\\HTTP\\\\ResponseInterface\\|null\\) of method CodeIgniter\\\\Filters\\\\FilterInterface\\:\\:after\\(\\)$#', + 'rawMessage' => 'Return type (void) of method CodeIgniter\\Shield\\Filters\\AbstractAuthFilter::after() should be compatible with return type (CodeIgniter\\HTTP\\ResponseInterface|null) of method CodeIgniter\\Filters\\FilterInterface::after()', 'identifier' => 'method.childReturnType', 'count' => 1, 'path' => __DIR__ . '/src/Filters/AbstractAuthFilter.php', ]; $ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\Shield\\\\Filters\\\\AuthRates\\:\\:before\\(\\) should return CodeIgniter\\\\HTTP\\\\RedirectResponse\\|void but returns CodeIgniter\\\\HTTP\\\\ResponseInterface\\.$#', + 'rawMessage' => 'Method CodeIgniter\\Shield\\Filters\\AuthRates::before() should return CodeIgniter\\HTTP\\RedirectResponse|void but returns CodeIgniter\\HTTP\\ResponseInterface.', 'identifier' => 'return.type', 'count' => 1, 'path' => __DIR__ . '/src/Filters/AuthRates.php', ]; $ignoreErrors[] = [ - 'message' => '#^Return type \\(CodeIgniter\\\\HTTP\\\\RedirectResponse\\|void\\) of method CodeIgniter\\\\Shield\\\\Filters\\\\AuthRates\\:\\:before\\(\\) should be covariant with return type \\(CodeIgniter\\\\HTTP\\\\RequestInterface\\|CodeIgniter\\\\HTTP\\\\ResponseInterface\\|string\\|null\\) of method CodeIgniter\\\\Filters\\\\FilterInterface\\:\\:before\\(\\)$#', + 'rawMessage' => 'Return type (CodeIgniter\\HTTP\\RedirectResponse|void) of method CodeIgniter\\Shield\\Filters\\AuthRates::before() should be covariant with return type (CodeIgniter\\HTTP\\RequestInterface|CodeIgniter\\HTTP\\ResponseInterface|string|null) of method CodeIgniter\\Filters\\FilterInterface::before()', 'identifier' => 'method.childReturnType', 'count' => 1, 'path' => __DIR__ . '/src/Filters/AuthRates.php', ]; $ignoreErrors[] = [ - 'message' => '#^Return type \\(void\\) of method CodeIgniter\\\\Shield\\\\Filters\\\\AuthRates\\:\\:after\\(\\) should be compatible with return type \\(CodeIgniter\\\\HTTP\\\\ResponseInterface\\|null\\) of method CodeIgniter\\\\Filters\\\\FilterInterface\\:\\:after\\(\\)$#', + 'rawMessage' => 'Return type (void) of method CodeIgniter\\Shield\\Filters\\AuthRates::after() should be compatible with return type (CodeIgniter\\HTTP\\ResponseInterface|null) of method CodeIgniter\\Filters\\FilterInterface::after()', 'identifier' => 'method.childReturnType', 'count' => 1, 'path' => __DIR__ . '/src/Filters/AuthRates.php', ]; $ignoreErrors[] = [ - 'message' => '#^Return type \\(CodeIgniter\\\\HTTP\\\\RedirectResponse\\|void\\) of method CodeIgniter\\\\Shield\\\\Filters\\\\ChainAuth\\:\\:before\\(\\) should be covariant with return type \\(CodeIgniter\\\\HTTP\\\\RequestInterface\\|CodeIgniter\\\\HTTP\\\\ResponseInterface\\|string\\|null\\) of method CodeIgniter\\\\Filters\\\\FilterInterface\\:\\:before\\(\\)$#', + 'rawMessage' => 'Return type (CodeIgniter\\HTTP\\RedirectResponse|void) of method CodeIgniter\\Shield\\Filters\\ChainAuth::before() should be covariant with return type (CodeIgniter\\HTTP\\RequestInterface|CodeIgniter\\HTTP\\ResponseInterface|string|null) of method CodeIgniter\\Filters\\FilterInterface::before()', 'identifier' => 'method.childReturnType', 'count' => 1, 'path' => __DIR__ . '/src/Filters/ChainAuth.php', ]; $ignoreErrors[] = [ - 'message' => '#^Return type \\(void\\) of method CodeIgniter\\\\Shield\\\\Filters\\\\ChainAuth\\:\\:after\\(\\) should be compatible with return type \\(CodeIgniter\\\\HTTP\\\\ResponseInterface\\|null\\) of method CodeIgniter\\\\Filters\\\\FilterInterface\\:\\:after\\(\\)$#', + 'rawMessage' => 'Return type (void) of method CodeIgniter\\Shield\\Filters\\ChainAuth::after() should be compatible with return type (CodeIgniter\\HTTP\\ResponseInterface|null) of method CodeIgniter\\Filters\\FilterInterface::after()', 'identifier' => 'method.childReturnType', 'count' => 1, 'path' => __DIR__ . '/src/Filters/ChainAuth.php', ]; $ignoreErrors[] = [ - 'message' => '#^Return type \\(CodeIgniter\\\\HTTP\\\\RedirectResponse\\|void\\) of method CodeIgniter\\\\Shield\\\\Filters\\\\ForcePasswordResetFilter\\:\\:before\\(\\) should be covariant with return type \\(CodeIgniter\\\\HTTP\\\\RequestInterface\\|CodeIgniter\\\\HTTP\\\\ResponseInterface\\|string\\|null\\) of method CodeIgniter\\\\Filters\\\\FilterInterface\\:\\:before\\(\\)$#', + 'rawMessage' => 'Return type (CodeIgniter\\HTTP\\RedirectResponse|void) of method CodeIgniter\\Shield\\Filters\\ForcePasswordResetFilter::before() should be covariant with return type (CodeIgniter\\HTTP\\RequestInterface|CodeIgniter\\HTTP\\ResponseInterface|string|null) of method CodeIgniter\\Filters\\FilterInterface::before()', 'identifier' => 'method.childReturnType', 'count' => 1, 'path' => __DIR__ . '/src/Filters/ForcePasswordResetFilter.php', ]; $ignoreErrors[] = [ - 'message' => '#^Return type \\(void\\) of method CodeIgniter\\\\Shield\\\\Filters\\\\ForcePasswordResetFilter\\:\\:after\\(\\) should be compatible with return type \\(CodeIgniter\\\\HTTP\\\\ResponseInterface\\|null\\) of method CodeIgniter\\\\Filters\\\\FilterInterface\\:\\:after\\(\\)$#', + 'rawMessage' => 'Return type (void) of method CodeIgniter\\Shield\\Filters\\ForcePasswordResetFilter::after() should be compatible with return type (CodeIgniter\\HTTP\\ResponseInterface|null) of method CodeIgniter\\Filters\\FilterInterface::after()', 'identifier' => 'method.childReturnType', 'count' => 1, 'path' => __DIR__ . '/src/Filters/ForcePasswordResetFilter.php', ]; $ignoreErrors[] = [ - 'message' => '#^Return type \\(void\\) of method CodeIgniter\\\\Shield\\\\Filters\\\\HmacAuth\\:\\:after\\(\\) should be compatible with return type \\(CodeIgniter\\\\HTTP\\\\ResponseInterface\\|null\\) of method CodeIgniter\\\\Filters\\\\FilterInterface\\:\\:after\\(\\)$#', + 'rawMessage' => 'Return type (void) of method CodeIgniter\\Shield\\Filters\\HmacAuth::after() should be compatible with return type (CodeIgniter\\HTTP\\ResponseInterface|null) of method CodeIgniter\\Filters\\FilterInterface::after()', 'identifier' => 'method.childReturnType', 'count' => 1, 'path' => __DIR__ . '/src/Filters/HmacAuth.php', ]; $ignoreErrors[] = [ - 'message' => '#^Return type \\(CodeIgniter\\\\HTTP\\\\ResponseInterface\\|void\\) of method CodeIgniter\\\\Shield\\\\Filters\\\\JWTAuth\\:\\:before\\(\\) should be covariant with return type \\(CodeIgniter\\\\HTTP\\\\RequestInterface\\|CodeIgniter\\\\HTTP\\\\ResponseInterface\\|string\\|null\\) of method CodeIgniter\\\\Filters\\\\FilterInterface\\:\\:before\\(\\)$#', + 'rawMessage' => 'Return type (CodeIgniter\\HTTP\\ResponseInterface|void) of method CodeIgniter\\Shield\\Filters\\JWTAuth::before() should be covariant with return type (CodeIgniter\\HTTP\\RequestInterface|CodeIgniter\\HTTP\\ResponseInterface|string|null) of method CodeIgniter\\Filters\\FilterInterface::before()', 'identifier' => 'method.childReturnType', 'count' => 1, 'path' => __DIR__ . '/src/Filters/JWTAuth.php', ]; $ignoreErrors[] = [ - 'message' => '#^Return type \\(void\\) of method CodeIgniter\\\\Shield\\\\Filters\\\\JWTAuth\\:\\:after\\(\\) should be compatible with return type \\(CodeIgniter\\\\HTTP\\\\ResponseInterface\\|null\\) of method CodeIgniter\\\\Filters\\\\FilterInterface\\:\\:after\\(\\)$#', + 'rawMessage' => 'Return type (void) of method CodeIgniter\\Shield\\Filters\\JWTAuth::after() should be compatible with return type (CodeIgniter\\HTTP\\ResponseInterface|null) of method CodeIgniter\\Filters\\FilterInterface::after()', 'identifier' => 'method.childReturnType', 'count' => 1, 'path' => __DIR__ . '/src/Filters/JWTAuth.php', ]; $ignoreErrors[] = [ - 'message' => '#^Return type \\(CodeIgniter\\\\HTTP\\\\RedirectResponse\\|void\\) of method CodeIgniter\\\\Shield\\\\Filters\\\\SessionAuth\\:\\:before\\(\\) should be covariant with return type \\(CodeIgniter\\\\HTTP\\\\RequestInterface\\|CodeIgniter\\\\HTTP\\\\ResponseInterface\\|string\\|null\\) of method CodeIgniter\\\\Filters\\\\FilterInterface\\:\\:before\\(\\)$#', + 'rawMessage' => 'Return type (CodeIgniter\\HTTP\\RedirectResponse|void) of method CodeIgniter\\Shield\\Filters\\SessionAuth::before() should be covariant with return type (CodeIgniter\\HTTP\\RequestInterface|CodeIgniter\\HTTP\\ResponseInterface|string|null) of method CodeIgniter\\Filters\\FilterInterface::before()', 'identifier' => 'method.childReturnType', 'count' => 1, 'path' => __DIR__ . '/src/Filters/SessionAuth.php', ]; $ignoreErrors[] = [ - 'message' => '#^Return type \\(void\\) of method CodeIgniter\\\\Shield\\\\Filters\\\\SessionAuth\\:\\:after\\(\\) should be compatible with return type \\(CodeIgniter\\\\HTTP\\\\ResponseInterface\\|null\\) of method CodeIgniter\\\\Filters\\\\FilterInterface\\:\\:after\\(\\)$#', + 'rawMessage' => 'Return type (void) of method CodeIgniter\\Shield\\Filters\\SessionAuth::after() should be compatible with return type (CodeIgniter\\HTTP\\ResponseInterface|null) of method CodeIgniter\\Filters\\FilterInterface::after()', 'identifier' => 'method.childReturnType', 'count' => 1, 'path' => __DIR__ . '/src/Filters/SessionAuth.php', ]; $ignoreErrors[] = [ - 'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#', + 'rawMessage' => 'Construct empty() is not allowed. Use more strict comparison.', 'identifier' => 'empty.notAllowed', 'count' => 1, 'path' => __DIR__ . '/src/Filters/TokenAuth.php', ]; $ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\Shield\\\\Filters\\\\TokenAuth\\:\\:before\\(\\) should return CodeIgniter\\\\HTTP\\\\RedirectResponse\\|void but returns CodeIgniter\\\\HTTP\\\\ResponseInterface\\.$#', + 'rawMessage' => 'Method CodeIgniter\\Shield\\Filters\\TokenAuth::before() should return CodeIgniter\\HTTP\\RedirectResponse|void but returns CodeIgniter\\HTTP\\ResponseInterface.', 'identifier' => 'return.type', 'count' => 2, 'path' => __DIR__ . '/src/Filters/TokenAuth.php', ]; $ignoreErrors[] = [ - 'message' => '#^Return type \\(CodeIgniter\\\\HTTP\\\\RedirectResponse\\|void\\) of method CodeIgniter\\\\Shield\\\\Filters\\\\TokenAuth\\:\\:before\\(\\) should be covariant with return type \\(CodeIgniter\\\\HTTP\\\\RequestInterface\\|CodeIgniter\\\\HTTP\\\\ResponseInterface\\|string\\|null\\) of method CodeIgniter\\\\Filters\\\\FilterInterface\\:\\:before\\(\\)$#', + 'rawMessage' => 'Return type (CodeIgniter\\HTTP\\RedirectResponse|void) of method CodeIgniter\\Shield\\Filters\\TokenAuth::before() should be covariant with return type (CodeIgniter\\HTTP\\RequestInterface|CodeIgniter\\HTTP\\ResponseInterface|string|null) of method CodeIgniter\\Filters\\FilterInterface::before()', 'identifier' => 'method.childReturnType', 'count' => 1, 'path' => __DIR__ . '/src/Filters/TokenAuth.php', ]; $ignoreErrors[] = [ - 'message' => '#^Return type \\(void\\) of method CodeIgniter\\\\Shield\\\\Filters\\\\TokenAuth\\:\\:after\\(\\) should be compatible with return type \\(CodeIgniter\\\\HTTP\\\\ResponseInterface\\|null\\) of method CodeIgniter\\\\Filters\\\\FilterInterface\\:\\:after\\(\\)$#', + 'rawMessage' => 'Return type (void) of method CodeIgniter\\Shield\\Filters\\TokenAuth::after() should be compatible with return type (CodeIgniter\\HTTP\\ResponseInterface|null) of method CodeIgniter\\Filters\\FilterInterface::after()', 'identifier' => 'method.childReturnType', 'count' => 1, 'path' => __DIR__ . '/src/Filters/TokenAuth.php', ]; $ignoreErrors[] = [ - 'message' => '#^Call to deprecated function random_string\\(\\)\\: -The type \'basic\', \'md5\', and \'sha1\' are deprecated\\. They are not cryptographically secure\\.$#', + 'rawMessage' => 'Call to deprecated function random_string(): +The type \'basic\', \'md5\', and \'sha1\' are deprecated. They are not cryptographically secure.', 'identifier' => 'function.deprecated', 'count' => 1, 'path' => __DIR__ . '/src/Models/TokenLoginModel.php', ]; $ignoreErrors[] = [ - 'message' => '#^Call to deprecated function random_string\\(\\)\\: -The type \'basic\', \'md5\', and \'sha1\' are deprecated\\. They are not cryptographically secure\\.$#', + 'rawMessage' => 'Call to deprecated function random_string(): +The type \'basic\', \'md5\', and \'sha1\' are deprecated. They are not cryptographically secure.', 'identifier' => 'function.deprecated', 'count' => 1, 'path' => __DIR__ . '/src/Models/UserIdentityModel.php', ]; $ignoreErrors[] = [ - 'message' => '#^Call to function model with CodeIgniter\\\\Shield\\\\Models\\\\GroupModel\\:\\:class is discouraged\\.$#', + 'rawMessage' => 'Call to function model with CodeIgniter\\Shield\\Models\\GroupModel::class is discouraged.', 'identifier' => 'codeigniter.factoriesClassConstFetch', 'count' => 2, 'path' => __DIR__ . '/src/Models/UserModel.php', ]; $ignoreErrors[] = [ - 'message' => '#^Call to function model with CodeIgniter\\\\Shield\\\\Models\\\\PermissionModel\\:\\:class is discouraged\\.$#', + 'rawMessage' => 'Call to function model with CodeIgniter\\Shield\\Models\\PermissionModel::class is discouraged.', 'identifier' => 'codeigniter.factoriesClassConstFetch', 'count' => 1, 'path' => __DIR__ . '/src/Models/UserModel.php', ]; $ignoreErrors[] = [ - 'message' => '#^Call to function model with CodeIgniter\\\\Shield\\\\Models\\\\UserIdentityModel\\:\\:class is discouraged\\.$#', + 'rawMessage' => 'Call to function model with CodeIgniter\\Shield\\Models\\UserIdentityModel::class is discouraged.', 'identifier' => 'codeigniter.factoriesClassConstFetch', 'count' => 1, 'path' => __DIR__ . '/src/Models/UserModel.php', ]; $ignoreErrors[] = [ - 'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#', + 'rawMessage' => 'Construct empty() is not allowed. Use more strict comparison.', 'identifier' => 'empty.notAllowed', 'count' => 2, 'path' => __DIR__ . '/src/Models/UserModel.php', ]; $ignoreErrors[] = [ - 'message' => '#^Parameter \\#1 \\$row \\(array\\|CodeIgniter\\\\Shield\\\\Entities\\\\User\\) of method CodeIgniter\\\\Shield\\\\Models\\\\UserModel\\:\\:insert\\(\\) should be contravariant with parameter \\$row \\(array\\\\|object\\|null\\) of method CodeIgniter\\\\Model\\:\\:insert\\(\\)$#', + 'rawMessage' => 'Parameter #1 $row (array|CodeIgniter\\Shield\\Entities\\User) of method CodeIgniter\\Shield\\Models\\UserModel::insert() should be contravariant with parameter $row (array|object|null) of method CodeIgniter\\Model::insert()', 'identifier' => 'method.childParameterType', 'count' => 1, 'path' => __DIR__ . '/src/Models/UserModel.php', ]; $ignoreErrors[] = [ - 'message' => '#^Parameter \\#1 \\$row \\(array\\|CodeIgniter\\\\Shield\\\\Entities\\\\User\\) of method CodeIgniter\\\\Shield\\\\Models\\\\UserModel\\:\\:save\\(\\) should be contravariant with parameter \\$row \\(array\\\\|object\\) of method CodeIgniter\\\\BaseModel\\:\\:save\\(\\)$#', + 'rawMessage' => 'Parameter #1 $row (array|CodeIgniter\\Shield\\Entities\\User) of method CodeIgniter\\Shield\\Models\\UserModel::save() should be contravariant with parameter $row (array|object) of method CodeIgniter\\BaseModel::save()', 'identifier' => 'method.childParameterType', 'count' => 1, 'path' => __DIR__ . '/src/Models/UserModel.php', ]; $ignoreErrors[] = [ - 'message' => '#^Parameter \\#2 \\$row \\(array\\|CodeIgniter\\\\Shield\\\\Entities\\\\User\\) of method CodeIgniter\\\\Shield\\\\Models\\\\UserModel\\:\\:update\\(\\) should be contravariant with parameter \\$row \\(array\\\\|object\\|null\\) of method CodeIgniter\\\\Model\\:\\:update\\(\\)$#', + 'rawMessage' => 'Parameter #2 $row (array|CodeIgniter\\Shield\\Entities\\User) of method CodeIgniter\\Shield\\Models\\UserModel::update() should be contravariant with parameter $row (array|object|null) of method CodeIgniter\\Model::update()', 'identifier' => 'method.childParameterType', 'count' => 1, 'path' => __DIR__ . '/src/Models/UserModel.php', ]; $ignoreErrors[] = [ - 'message' => '#^Return type \\(int\\|string\\|true\\) of method CodeIgniter\\\\Shield\\\\Models\\\\UserModel\\:\\:insert\\(\\) should be covariant with return type \\(\\(\\$returnID is true \\? int\\|string\\|false \\: bool\\)\\) of method CodeIgniter\\\\Model\\:\\:insert\\(\\)$#', + 'rawMessage' => 'Return type (int|string|true) of method CodeIgniter\\Shield\\Models\\UserModel::insert() should be covariant with return type (($returnID is true ? int|string|false : bool)) of method CodeIgniter\\Model::insert()', 'identifier' => 'method.childReturnType', 'count' => 1, 'path' => __DIR__ . '/src/Models/UserModel.php', ]; $ignoreErrors[] = [ - 'message' => '#^Call to method PHPUnit\\\\Framework\\\\Assert\\:\\:assertInstanceOf\\(\\) with \'CodeIgniter\\\\\\\\Shield\\\\\\\\Result\' and CodeIgniter\\\\Shield\\\\Result will always evaluate to true\\.$#', + 'rawMessage' => 'Call to method PHPUnit\\Framework\\Assert::assertInstanceOf() with \'CodeIgniter\\\\Shield\\\\Result\' and CodeIgniter\\Shield\\Result will always evaluate to true.', 'identifier' => 'method.alreadyNarrowedType', 'count' => 3, 'path' => __DIR__ . '/tests/Authentication/Authenticators/JWTAuthenticatorTest.php', ]; $ignoreErrors[] = [ - 'message' => '#^Call to method PHPUnit\\\\Framework\\\\Assert\\:\\:assertInstanceOf\\(\\) with \'CodeIgniter\\\\\\\\Shield\\\\\\\\Result\' and CodeIgniter\\\\Shield\\\\Result will always evaluate to true\\.$#', + 'rawMessage' => 'Call to method PHPUnit\\Framework\\Assert::assertInstanceOf() with \'CodeIgniter\\\\Shield\\\\Result\' and CodeIgniter\\Shield\\Result will always evaluate to true.', 'identifier' => 'method.alreadyNarrowedType', 'count' => 8, 'path' => __DIR__ . '/tests/Authentication/Authenticators/SessionAuthenticatorTest.php', ]; $ignoreErrors[] = [ - 'message' => '#^Implicit array creation is not allowed \\- variable \\$users might not exist\\.$#', + 'rawMessage' => 'Implicit array creation is not allowed - variable $users might not exist.', 'identifier' => 'variable.implicitArray', 'count' => 1, 'path' => __DIR__ . '/tests/Authentication/ForcePasswordResetTest.php', ]; $ignoreErrors[] = [ - 'message' => '#^Variable \\$users might not be defined\\.$#', + 'rawMessage' => 'Variable $users might not be defined.', 'identifier' => 'variable.undefined', 'count' => 1, 'path' => __DIR__ . '/tests/Authentication/ForcePasswordResetTest.php', ]; $ignoreErrors[] = [ - 'message' => '#^Call to method PHPUnit\\\\Framework\\\\Assert\\:\\:assertInstanceOf\\(\\) with \'CodeIgniter\\\\\\\\Shield\\\\\\\\Entities\\\\\\\\AccessToken\' and CodeIgniter\\\\Shield\\\\Entities\\\\AccessToken will always evaluate to true\\.$#', + 'rawMessage' => 'Call to method PHPUnit\\Framework\\Assert::assertInstanceOf() with \'CodeIgniter\\\\Shield\\\\Entities\\\\AccessToken\' and CodeIgniter\\Shield\\Entities\\AccessToken will always evaluate to true.', 'identifier' => 'method.alreadyNarrowedType', 'count' => 1, 'path' => __DIR__ . '/tests/Authentication/HasAccessTokensTest.php', ]; $ignoreErrors[] = [ - 'message' => '#^Only booleans are allowed in a ternary operator condition, string\\|null given\\.$#', + 'rawMessage' => 'Only booleans are allowed in a ternary operator condition, string|null given.', 'identifier' => 'ternary.condNotBoolean', 'count' => 2, 'path' => __DIR__ . '/tests/Language/AbstractTranslationTestCase.php', ]; $ignoreErrors[] = [ - 'message' => '#^Call to method PHPUnit\\\\Framework\\\\Assert\\:\\:assertIsString\\(\\) with string will always evaluate to true\\.$#', + 'rawMessage' => 'Call to method PHPUnit\\Framework\\Assert::assertIsString() with string will always evaluate to true.', 'identifier' => 'method.alreadyNarrowedType', 'count' => 6, 'path' => __DIR__ . '/tests/Unit/Authentication/JWT/JWTManagerTest.php', ]; $ignoreErrors[] = [ - 'message' => '#^Call to deprecated method __construct\\(\\) of class CodeIgniter\\\\HTTP\\\\Response\\: -4\\.5\\.0 The param \\$config is no longer used\\.$#', + 'rawMessage' => 'Call to deprecated method __construct() of class CodeIgniter\\HTTP\\Response: +4.5.0 The param $config is no longer used.', 'identifier' => 'method.deprecated', 'count' => 3, 'path' => __DIR__ . '/tests/Unit/PwnedValidatorTest.php', ]; $ignoreErrors[] = [ - 'message' => '#^Call to an undefined method CodeIgniter\\\\Shield\\\\Models\\\\UserModel\\:\\:getLastQuery\\(\\)\\.$#', + 'rawMessage' => 'Call to an undefined method CodeIgniter\\Shield\\Models\\UserModel::getLastQuery().', 'identifier' => 'method.notFound', 'count' => 7, 'path' => __DIR__ . '/tests/Unit/UserTest.php', ]; $ignoreErrors[] = [ - 'message' => '#^Call to method PHPUnit\\\\Framework\\\\Assert\\:\\:assertInstanceOf\\(\\) with \'CodeIgniter\\\\\\\\Shield\\\\\\\\Entities\\\\\\\\UserIdentity\' and CodeIgniter\\\\Shield\\\\Entities\\\\UserIdentity will always evaluate to true\\.$#', + 'rawMessage' => 'Call to method PHPUnit\\Framework\\Assert::assertInstanceOf() with \'CodeIgniter\\\\Shield\\\\Entities\\\\UserIdentity\' and CodeIgniter\\Shield\\Entities\\UserIdentity will always evaluate to true.', 'identifier' => 'method.alreadyNarrowedType', 'count' => 1, 'path' => __DIR__ . '/tests/Unit/UserTest.php', ]; $ignoreErrors[] = [ - 'message' => '#^Offset 1 does not exist on array\\{CodeIgniter\\\\Shield\\\\Entities\\\\User\\}\\.$#', + 'rawMessage' => 'Offset 1 does not exist on array{CodeIgniter\\Shield\\Entities\\User}.', 'identifier' => 'offsetAccess.notFound', 'count' => 5, 'path' => __DIR__ . '/tests/Unit/UserTest.php', diff --git a/src/Entities/User.php b/src/Entities/User.php index 8fef86822..c40dda40a 100644 --- a/src/Entities/User.php +++ b/src/Entities/User.php @@ -164,7 +164,7 @@ public function getEmailIdentity(): ?UserIdentity */ public function saveEmailIdentity(): bool { - if (empty($this->email) && empty($this->password) && empty($this->password_hash)) { + if (($this->email === null || $this->email === '') && ($this->password === null || $this->password === '') && ($this->password_hash === null || $this->password_hash === '')) { return true; } @@ -181,15 +181,15 @@ public function saveEmailIdentity(): bool $identity = $this->getEmailIdentity(); } - if (! empty($this->email)) { + if ($this->email !== null && $this->email !== '') { $identity->secret = $this->email; } - if (! empty($this->password)) { + if ($this->password !== null && $this->password !== '') { $identity->secret2 = service('passwords')->hash($this->password); } - if (! empty($this->password_hash) && empty($this->password)) { + if ($this->password_hash !== null && $this->password_hash !== '' && ($this->password === null || $this->password === '')) { $identity->secret2 = $this->password_hash; } diff --git a/src/Models/CheckQueryReturnTrait.php b/src/Models/CheckQueryReturnTrait.php index b6cd0e533..fc71897e8 100644 --- a/src/Models/CheckQueryReturnTrait.php +++ b/src/Models/CheckQueryReturnTrait.php @@ -86,10 +86,8 @@ protected function restoreDBDebug(): void protected function getPropertyDBDebug(): ReflectionProperty { - $refClass = new ReflectionObject($this->db); - $refProperty = $refClass->getProperty('DBDebug'); - $refProperty->setAccessible(true); + $refClass = new ReflectionObject($this->db); - return $refProperty; + return $refClass->getProperty('DBDebug'); } } diff --git a/tests/Unit/Authentication/JWT/JWTManagerTest.php b/tests/Unit/Authentication/JWT/JWTManagerTest.php index 7e9276f3f..4197184cb 100644 --- a/tests/Unit/Authentication/JWT/JWTManagerTest.php +++ b/tests/Unit/Authentication/JWT/JWTManagerTest.php @@ -31,7 +31,7 @@ private function createJWTManager(?Time $clock = null): JWTManager return new JWTManager($clock); } - public function testGenerateToken() + public function testGenerateToken(): array { /** @var User $user */ $user = fake(UserModel::class, ['id' => 1, 'username' => 'John Smith'], false); @@ -94,7 +94,7 @@ public function testGenerateTokenAddClaims(): void $this->assertStringStartsWith('admin@example.jp', $payload['email']); } - public function testIssue() + public function testIssue(): array { // Fix the current time for testing. Time::setTestNow('now'); diff --git a/tests/Unit/PwnedValidatorTest.php b/tests/Unit/PwnedValidatorTest.php index 9c8c386dd..7a266b13b 100644 --- a/tests/Unit/PwnedValidatorTest.php +++ b/tests/Unit/PwnedValidatorTest.php @@ -55,9 +55,7 @@ public function testCheckFalseOnPwnedPassword(): void $response = new Response(new App()); $response->setBody($body); - $curlrequest = $this->getMockBuilder('CodeIgniter\HTTP\CURLRequest') - ->disableOriginalConstructor() - ->getMock(); + $curlrequest = $this->createMock('CodeIgniter\HTTP\CURLRequest'); $curlrequest->method('get')->willReturn($response); @@ -77,9 +75,7 @@ public function testCheckFalseOnPwnedLastInRange(): void $response = new Response(new App()); $response->setBody($body); - $curlrequest = $this->getMockBuilder('CodeIgniter\HTTP\CURLRequest') - ->disableOriginalConstructor() - ->getMock(); + $curlrequest = $this->createMock('CodeIgniter\HTTP\CURLRequest'); $curlrequest->method('get')->willReturn($response); @@ -109,9 +105,7 @@ public function testCheckTrueOnNotFound(): void $response = new Response(new App()); $response->setBody($body); - $curlrequest = $this->getMockBuilder('CodeIgniter\HTTP\CURLRequest') - ->disableOriginalConstructor() - ->getMock(); + $curlrequest = $this->createMock('CodeIgniter\HTTP\CURLRequest'); $curlrequest->method('get')->willReturn($response); @@ -126,9 +120,7 @@ public function testCheckTrueOnNotFound(): void public function testCheckCatchesAndRethrowsCurlExceptionAsAuthException(): void { - $curlrequest = $this->getMockBuilder('CodeIgniter\HTTP\CURLRequest') - ->disableOriginalConstructor() - ->getMock(); + $curlrequest = $this->createMock('CodeIgniter\HTTP\CURLRequest'); $curlrequest->method('get') ->willThrowException(HTTPException::forCurlError(