Skip to content

Commit

Permalink
Fix strict rules errors
Browse files Browse the repository at this point in the history
  • Loading branch information
spaze committed Oct 13, 2024
1 parent b184ce5 commit 4781423
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 99 deletions.
2 changes: 1 addition & 1 deletion src/Google2FA.php
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ public function setEnforceGoogleAuthenticatorCompatibility(
public function setAlgorithm(string $algorithm): static
{
// Default to SHA1 HMAC algorithm
if (!in_array($algorithm, $this->getValidAlgorithms())) {
if (!in_array($algorithm, $this->getValidAlgorithms(), true)) {
throw new InvalidAlgorithmException();
}

Expand Down
2 changes: 1 addition & 1 deletion src/Support/Base32.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function generateBase32RandomKey(
#[\SensitiveParameter]
string $prefix = ''
): string {
$secret = $prefix ? $this->toBase32($prefix) : '';
$secret = $prefix !== '' ? $this->toBase32($prefix) : '';

$secret = $this->strPadBase32($secret, $length);

Expand Down
Loading

0 comments on commit 4781423

Please sign in to comment.