identifier = $identifier; $this->role = $challenge; $this->session = $session; } public function getIdentifier(): ?string { return $this->identifier; } public function getRole(): ?string { return $this->role; } public function getSession(): ?Session { return $this->session; } public static function fromArray(array $array = []): AuthenticationResult { $identifier = $array['identifier'] ?? null; $role = $array['role'] ?? null; $session = Session::fromArray($array['session']) ?? null; return new AuthenticationResult($identifier, $role, $session); } }