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 Error("Authentication is not set."); } if ($this->isEntryPoint) { return Auth::createForEntryPoint($this->authentication, $this->authRequired); } return new Auth($this->authentication, $this->authRequired); } }