Skip to content

Commit 157f21f

Browse files
committed
PHPStan changed to 8 and composer fix
1 parent 6cdc44a commit 157f21f

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

phpstan-baseline.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@
318318
];
319319
$ignoreErrors[] = [
320320
'message' => '#^Call to method PHPUnit\\\\Framework\\\\Assert\\:\\:assertInstanceOf\\(\\) with \'CodeIgniter\\\\\\\\Shield\\\\\\\\Result\' and CodeIgniter\\\\Shield\\\\Result will always evaluate to true\\.$#',
321-
'count' => 9,
321+
'count' => 8,
322322
'path' => __DIR__ . '/tests/Authentication/Authenticators/SessionAuthenticatorTest.php',
323323
];
324324
$ignoreErrors[] = [

src/Authentication/Authenticators/Session.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public function attempt(array $credentials): Result
130130
$result = $this->check($credentials);
131131

132132
// Credentials mismatch.
133-
if (!$result->isOK()) {
133+
if (! $result->isOK()) {
134134
// Always record a login attempt, whether success or not.
135135
$this->recordLoginAttempt($credentials, false, $ipAddress, $userAgent);
136136

@@ -173,7 +173,7 @@ public function attempt(array $credentials): Result
173173

174174
$this->issueRememberMeToken();
175175

176-
if (!$this->hasAction()) {
176+
if (! $this->hasAction()) {
177177
$this->completeLogin($user);
178178
}
179179

@@ -284,10 +284,10 @@ private function recordLoginAttempt(
284284

285285
$field = array_pop($field);
286286

287-
if (!in_array($field, ['email', 'username'], true)) {
287+
if (! in_array($field, ['email', 'username'], true)) {
288288
$idType = $field;
289289
} else {
290-
$idType = (!isset($credentials['email']) && isset($credentials['username']))
290+
$idType = (! isset($credentials['email']) && isset($credentials['username']))
291291
? self::ID_TYPE_USERNAME
292292
: self::ID_TYPE_EMAIL_PASSWORD;
293293
}
@@ -337,7 +337,7 @@ public function check(array $credentials): Result
337337
$passwords = service('passwords');
338338

339339
// Now, try matching the passwords.
340-
if (!$passwords->verify($givenPassword, $user->password_hash)) {
340+
if (! $passwords->verify($givenPassword, $user->password_hash)) {
341341
return new Result([
342342
'success' => false,
343343
'reason' => lang('Auth.invalidPassword'),
@@ -885,7 +885,7 @@ public function getPendingUser(): ?User
885885
*/
886886
public function recordActiveDate(): void
887887
{
888-
if (!$this->user instanceof User) {
888+
if (! $this->user instanceof User) {
889889
throw new InvalidArgumentException(
890890
__METHOD__ . '() requires logged in user before calling.'
891891
);

tests/Authentication/Authenticators/SessionAuthenticatorTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
use CodeIgniter\Shield\Entities\User;
1313
use CodeIgniter\Shield\Exceptions\LogicException;
1414
use CodeIgniter\Shield\Models\RememberModel;
15-
use CodeIgniter\Shield\Models\UserIdentityModel;
1615
use CodeIgniter\Shield\Models\UserModel;
1716
use CodeIgniter\Shield\Result;
1817
use CodeIgniter\Test\Mock\MockEvents;

0 commit comments

Comments
 (0)