Skip to content

Commit c528352

Browse files
omerimzalikenjis
authored andcommitted
PHPStan changed to 8 and composer fix
1 parent f54d7bf commit c528352

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
@@ -348,7 +348,7 @@
348348
];
349349
$ignoreErrors[] = [
350350
'message' => '#^Call to method PHPUnit\\\\Framework\\\\Assert\\:\\:assertInstanceOf\\(\\) with \'CodeIgniter\\\\\\\\Shield\\\\\\\\Result\' and CodeIgniter\\\\Shield\\\\Result will always evaluate to true\\.$#',
351-
'count' => 9,
351+
'count' => 8,
352352
'path' => __DIR__ . '/tests/Authentication/Authenticators/SessionAuthenticatorTest.php',
353353
];
354354
$ignoreErrors[] = [

src/Authentication/Authenticators/Session.php

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

139139
// Credentials mismatch.
140-
if (!$result->isOK()) {
140+
if (! $result->isOK()) {
141141
// Always record a login attempt, whether success or not.
142142
$this->recordLoginAttempt($credentials, false, $ipAddress, $userAgent);
143143

@@ -180,7 +180,7 @@ public function attempt(array $credentials): Result
180180

181181
$this->issueRememberMeToken();
182182

183-
if (!$this->hasAction()) {
183+
if (! $this->hasAction()) {
184184
$this->completeLogin($user);
185185
}
186186

@@ -291,10 +291,10 @@ private function recordLoginAttempt(
291291

292292
$field = array_pop($field);
293293

294-
if (!in_array($field, ['email', 'username'], true)) {
294+
if (! in_array($field, ['email', 'username'], true)) {
295295
$idType = $field;
296296
} else {
297-
$idType = (!isset($credentials['email']) && isset($credentials['username']))
297+
$idType = (! isset($credentials['email']) && isset($credentials['username']))
298298
? self::ID_TYPE_USERNAME
299299
: self::ID_TYPE_EMAIL_PASSWORD;
300300
}
@@ -344,7 +344,7 @@ public function check(array $credentials): Result
344344
$passwords = service('passwords');
345345

346346
// Now, try matching the passwords.
347-
if (!$passwords->verify($givenPassword, $user->password_hash)) {
347+
if (! $passwords->verify($givenPassword, $user->password_hash)) {
348348
return new Result([
349349
'success' => false,
350350
'reason' => lang('Auth.invalidPassword'),
@@ -892,7 +892,7 @@ public function getPendingUser(): ?User
892892
*/
893893
public function recordActiveDate(): void
894894
{
895-
if (!$this->user instanceof User) {
895+
if (! $this->user instanceof User) {
896896
throw new InvalidArgumentException(
897897
__METHOD__ . '() requires logged in user before calling.'
898898
);

tests/Authentication/Authenticators/SessionAuthenticatorTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
use CodeIgniter\Shield\Entities\User;
2222
use CodeIgniter\Shield\Exceptions\LogicException;
2323
use CodeIgniter\Shield\Models\RememberModel;
24-
use CodeIgniter\Shield\Models\UserIdentityModel;
2524
use CodeIgniter\Shield\Models\UserModel;
2625
use CodeIgniter\Shield\Result;
2726
use CodeIgniter\Test\Mock\MockEvents;

0 commit comments

Comments
 (0)