diff --git a/src/Factory.php b/src/Factory.php index 77be598..287ac81 100644 --- a/src/Factory.php +++ b/src/Factory.php @@ -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