-
Notifications
You must be signed in to change notification settings - Fork 208
Open
Description
Possible null argument in App\Entity\User::getTotpAuthenticationConfiguration() method.
User::totpSecret is nullable:
#[ORM\Column(type: Types::STRING, nullable: true)]
private ?string $totpSecret = null;User::getTotpAuthenticationConfiguration() returns null|TotpConfigurationInterface. To prevent \RuntimeExceptions and comply w/ the interface method signature, we should be doing:
// App\Entity\User
public function getTotpAuthenticationConfiguration(): ?TotpConfigurationInterface
{
return $this->totpSecret ? new TotpConfiguration($this->totpSecret, TotpConfiguration::ALGORITHM_SHA1, 30, 6) : null;
}Metadata
Metadata
Assignees
Labels
No labels
