Don't rely on truthy/falsey

master
Brady McDonough 2 years ago
parent 43019296f9
commit 5d7f11db47

@ -19,21 +19,21 @@ class Factory
public function __construct(
private PersistenceInterface $db,
private RequestInterface $request,
private null|SessionInterface $session,
private null|\PSR\Clock\ClockInterface $csrfClock,
private null|AntiCSRFInterface $csrf,
private null|\PSR\Clock\ClockInterface $totpClock,
private null|HashInterface $hash,
private ?SessionInterface $session,
private ?\PSR\Clock\ClockInterface $csrfClock,
private ?AntiCSRFInterface $csrf,
private ?\PSR\Clock\ClockInterface $totpClock,
private ?HashInterface $hash,
)
{
$this->session ? : $this->session = new Session\Base();
$this->csrf_clock ? : $this->csrfClock = new Clock\Request();
$this->csrf ? : $this->csrf = new AntiCSRF\Base(
!is_null($this->session)? : $this->session = new Session\Base();
!is_null($this->csrf_clock)? : $this->csrfClock = new Clock\Request();
!is_null($this->csrf)? : $this->csrf = new AntiCSRF\Base(
$this->session,
$this->csrf_clock
);
$this->totp_clock ? : $this->totpClock = new Clock\Base();
$this->$hash ? : $this->hash = new Hash\HMAC_SHA1();
!is_null($this->totp_clock)? : $this->totpClock = new Clock\Base();
!is_null($this->$hash)? : $this->hash = new Hash\HMAC_SHA1();
}
public function userManagement(mixed $userIndex): UserManagement

Loading…
Cancel
Save