log = $log; } public function setAuthentication(Authentication $authentication): self { $this->authentication = $authentication; return $this; } public function setAuthRequired(bool $authRequired): self { $this->authRequired = $authRequired; return $this; } public function forEntryPoint(): self { $this->isEntryPoint = true; return $this; } public function build(): Auth { if (!$this->authentication) { throw new RuntimeException("Authentication is not set."); } return new Auth($this->log, $this->authentication, $this->authRequired, $this->isEntryPoint); } }