Skip to content

Commit 9b5c2bf

Browse files
authored
Merge pull request #963 from kenjis/remove-deleted_at
refactor: remove unneeded deleted_at in $allowedFields
2 parents 8de5f73 + 9f715f9 commit 9b5c2bf

File tree

2 files changed

+1
-21
lines changed

2 files changed

+1
-21
lines changed

phpstan-baseline.php

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -311,31 +311,11 @@
311311
'count' => 1,
312312
'path' => __DIR__ . '/src/Models/UserIdentityModel.php',
313313
];
314-
$ignoreErrors[] = [
315-
'message' => '#^Cannot unset offset \'email\' on array\\{username\\: string, status\\: string, status_message\\: string, active\\: bool, last_active\\: string, deleted_at\\: string\\}\\.$#',
316-
'count' => 1,
317-
'path' => __DIR__ . '/src/Models/UserModel.php',
318-
];
319-
$ignoreErrors[] = [
320-
'message' => '#^Cannot unset offset \'password_hash\' on array\\{username\\: string, status\\: string, status_message\\: string, active\\: bool, last_active\\: string, deleted_at\\: string\\}\\.$#',
321-
'count' => 1,
322-
'path' => __DIR__ . '/src/Models/UserModel.php',
323-
];
324314
$ignoreErrors[] = [
325315
'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#',
326316
'count' => 2,
327317
'path' => __DIR__ . '/src/Models/UserModel.php',
328318
];
329-
$ignoreErrors[] = [
330-
'message' => '#^Offset \'email\' does not exist on array\\{username\\: string, status\\: string, status_message\\: string, active\\: bool, last_active\\: string, deleted_at\\: string\\}\\.$#',
331-
'count' => 1,
332-
'path' => __DIR__ . '/src/Models/UserModel.php',
333-
];
334-
$ignoreErrors[] = [
335-
'message' => '#^Offset \'password_hash\' does not exist on array\\{username\\: string, status\\: string, status_message\\: string, active\\: bool, last_active\\: string, deleted_at\\: string\\}\\.$#',
336-
'count' => 1,
337-
'path' => __DIR__ . '/src/Models/UserModel.php',
338-
];
339319
$ignoreErrors[] = [
340320
'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\\(\\)$#',
341321
'count' => 1,

src/Models/UserModel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ class UserModel extends BaseModel
3636
'status_message',
3737
'active',
3838
'last_active',
39-
'deleted_at',
4039
];
4140
protected $useTimestamps = true;
4241
protected $afterFind = ['fetchIdentities'];
@@ -205,6 +204,7 @@ public function findByCredentials(array $credentials): ?User
205204
}
206205

207206
if ($email !== null) {
207+
/** @var array<string, int|string|null>|null $data */
208208
$data = $this->select(
209209
sprintf('%1$s.*, %2$s.secret as email, %2$s.secret2 as password_hash', $this->table, $this->tables['identities'])
210210
)

0 commit comments

Comments
 (0)