Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 3 additions & 28 deletions phpstan-baseline.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,16 +158,6 @@
'count' => 1,
'path' => __DIR__ . '/src/Collectors/Auth.php',
];
$ignoreErrors[] = [
'message' => '#^PHPDoc type array\\<string, string\\> of property CodeIgniter\\\\Shield\\\\Commands\\\\Generators\\\\UserModelGenerator\\:\\:\\$arguments is not the same as PHPDoc type array of overridden property CodeIgniter\\\\CLI\\\\BaseCommand\\:\\:\\$arguments\\.$#',
'count' => 1,
'path' => __DIR__ . '/src/Commands/Generators/UserModelGenerator.php',
];
$ignoreErrors[] = [
'message' => '#^PHPDoc type array\\<string, string\\> of property CodeIgniter\\\\Shield\\\\Commands\\\\Generators\\\\UserModelGenerator\\:\\:\\$options is not the same as PHPDoc type array of overridden property CodeIgniter\\\\CLI\\\\BaseCommand\\:\\:\\$options\\.$#',
'count' => 1,
'path' => __DIR__ . '/src/Commands/Generators/UserModelGenerator.php',
];
$ignoreErrors[] = [
'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#',
'count' => 1,
Expand Down Expand Up @@ -317,28 +307,13 @@
'path' => __DIR__ . '/src/Models/UserModel.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\$data \\(array\\|CodeIgniter\\\\Shield\\\\Entities\\\\User\\) of method CodeIgniter\\\\Shield\\\\Models\\\\UserModel\\:\\:insert\\(\\) should be contravariant with parameter \\$data \\(array\\|object\\|null\\) of method CodeIgniter\\\\Model\\:\\:insert\\(\\)$#',
'count' => 1,
'path' => __DIR__ . '/src/Models/UserModel.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\$data \\(array\\|CodeIgniter\\\\Shield\\\\Entities\\\\User\\) of method CodeIgniter\\\\Shield\\\\Models\\\\UserModel\\:\\:save\\(\\) should be contravariant with parameter \\$data \\(array\\|object\\) of method CodeIgniter\\\\BaseModel\\:\\:save\\(\\)$#',
'count' => 1,
'path' => __DIR__ . '/src/Models/UserModel.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#2 \\$data \\(array\\|CodeIgniter\\\\Shield\\\\Entities\\\\User\\) of method CodeIgniter\\\\Shield\\\\Models\\\\UserModel\\:\\:update\\(\\) should be contravariant with parameter \\$data \\(array\\|object\\|null\\) of method CodeIgniter\\\\Model\\:\\:update\\(\\)$#',
'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 \\(int\\|object\\|string\\|false\\) of method CodeIgniter\\\\Model\\:\\:insert\\(\\)$#',
'message' => '#^Call to function model with CodeIgniter\\\\Shield\\\\Models\\\\UserIdentityModel\\:\\:class is discouraged\\.$#',
'count' => 1,
'path' => __DIR__ . '/src/Models/UserModel.php',
];
$ignoreErrors[] = [
'message' => '#^Call to function model with CodeIgniter\\\\Shield\\\\Models\\\\UserIdentityModel\\:\\:class is discouraged\\.$#',
'count' => 1,
'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\\(\\)\\$#',
'count' => 4,
'path' => __DIR__ . '/src/Models/UserModel.php',
];
$ignoreErrors[] = [
Expand Down
4 changes: 2 additions & 2 deletions src/Commands/Hmac.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class Hmac extends BaseCommand
/**
* the Command's Arguments
*
* @var array
* @var array<string, string>
*/
protected $arguments = [
'action' => <<<'EOL'
Expand All @@ -72,7 +72,7 @@ class Hmac extends BaseCommand
/**
* the Command's Options
*
* @var array
* @var array<string, string>
*/
protected $options = [];

Expand Down
4 changes: 2 additions & 2 deletions src/Commands/Setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ class Setup extends BaseCommand
/**
* the Command's Arguments
*
* @var array
* @var array<string, string>
*/
protected $arguments = [];

/**
* the Command's Options
*
* @var array
* @var array<string, string>
*/
protected $options = [
'-f' => 'Force overwrite ALL existing files in destination.',
Expand Down
4 changes: 2 additions & 2 deletions src/Commands/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class User extends BaseCommand
/**
* Command's Arguments
*
* @var array
* @var array<string, string>
*/
protected $arguments = [
'action' => <<<'EOL'
Expand All @@ -107,7 +107,7 @@ class User extends BaseCommand
/**
* Command's Options
*
* @var array
* @var array<string, string>
*/
protected $options = [
'-i' => 'User id',
Expand Down
4 changes: 2 additions & 2 deletions tests/Authentication/MagicLinkTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public function testMagicLinkVerifyExpired(): void
'user_id' => $user->id,
'type' => Session::ID_TYPE_MAGIC_LINK,
'secret' => 'abasdasdf',
'expires' => Time::now()->subDays(5),
'expires' => Time::now()->subDays(5)->format('Y-m-d H:i:s'),
]);

$result = $this->get(route_to('verify-magic-link') . '?token=abasdasdf');
Expand All @@ -136,7 +136,7 @@ public function testMagicLinkVerifySuccess(): void
'user_id' => $user->id,
'type' => Session::ID_TYPE_MAGIC_LINK,
'secret' => 'abasdasdf',
'expires' => Time::now()->addMinutes(60),
'expires' => Time::now()->addMinutes(60)->format('Y-m-d H:i:s'),
]);

$result = $this->get(route_to('verify-magic-link') . '?token=abasdasdf');
Expand Down
2 changes: 1 addition & 1 deletion tests/Controllers/MagicLinkTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public function testMagicLinkVerifyPendingRegistrationActivation(): void
'user_id' => $user->id,
'type' => Session::ID_TYPE_MAGIC_LINK,
'secret' => 'abasdasdf',
'expires' => Time::now()->addMinutes(60),
'expires' => Time::now()->addMinutes(60)->format('Y-m-d H:i:s'),
]);

$result = $this->get(route_to('verify-magic-link') . '?token=abasdasdf');
Expand Down