Skip to content

Commit b79a28c

Browse files
authored
Fix risky falsy comparision thanks to Psalm (#281)
1 parent 8f14995 commit b79a28c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ResetPasswordHelper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function generateResetToken(object $user, int $resetRequestLifetime = nul
6868
throw new TooManyPasswordRequestsException($availableAt);
6969
}
7070

71-
$resetRequestLifetime = $resetRequestLifetime ?: $this->resetRequestLifetime;
71+
$resetRequestLifetime = $resetRequestLifetime ?? $this->resetRequestLifetime;
7272

7373
$expiresAt = new \DateTimeImmutable(sprintf('+%d seconds', $resetRequestLifetime));
7474

@@ -161,7 +161,7 @@ public function getTokenLifetime(): int
161161
*/
162162
public function generateFakeResetToken(int $resetRequestLifetime = null): ResetPasswordToken
163163
{
164-
$resetRequestLifetime = $resetRequestLifetime ?: $this->resetRequestLifetime;
164+
$resetRequestLifetime = $resetRequestLifetime ?? $this->resetRequestLifetime;
165165
$expiresAt = new \DateTimeImmutable(sprintf('+%d seconds', $resetRequestLifetime));
166166

167167
$generatedAt = ($expiresAt->getTimestamp() - $resetRequestLifetime);

0 commit comments

Comments
 (0)