diff --git a/src/Factory.php b/src/Factory.php index 287ac81..8bc2ef9 100644 --- a/src/Factory.php +++ b/src/Factory.php @@ -2,10 +2,18 @@ namespace BradyMcD\TAATP; +use BradyMcD\TAATP\AntiCSRFInterface; +use PSR\Clock\ClockInterface; +use BradyMcD\TAATP\HashInterface; use BradyMcD\TAATP\Required\PersistenceInterface; use BradyMcD\TAATP\Required\RequestInterface; use BradyMcD\TAATP\SessionInterface; -use BradyMcD\TAATP\AntiCSRFInterface; + +use BradyMcD\TAATP\AntiCSRF\Base as AntiCSRF; +use BradyMcD\TAATP\Clock\Request as RequestClock; +use BradyMcD\TAATP\Clock\Base as Clock; +use BradyMcD\TAATP\Hash\HMAC_SHA1; +use BradyMcD\TAATP\Session\Base as Session; use BradyMcD\TAATP\Workflow\UserManagement; use BradyMcD\TAATP\Workflow\Authenticate; @@ -20,20 +28,20 @@ class Factory private PersistenceInterface $db, private RequestInterface $request, private ?SessionInterface $session, - private ?\PSR\Clock\ClockInterface $csrfClock, + private ?ClockInterface $csrfClock, private ?AntiCSRFInterface $csrf, - private ?\PSR\Clock\ClockInterface $totpClock, + private ?ClockInterface $totpClock, private ?HashInterface $hash, ) { - !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( + !is_null($this->session) ? : $this->session = new Session(); + !is_null($this->csrf_clock) ? : $this->csrfClock = new RequestClock(); + !is_null($this->csrf) ? : $this->csrf = new AntiCSRF( $this->session, $this->csrf_clock ); - !is_null($this->totp_clock)? : $this->totpClock = new Clock\Base(); - !is_null($this->$hash)? : $this->hash = new Hash\HMAC_SHA1(); + !is_null($this->totp_clock) ? : $this->totpClock = new Clock(); + !is_null($this->$hash) ? : $this->hash = new HMAC_SHA1(); } public function userManagement(mixed $userIndex): UserManagement