id; } /** * Get api_key. * * @return string */ public function getApiKey() { return $this->api_key; } /** * Set api_key. * * @param string $apiKey * * @return PasskeysAuthConfig */ public function setApiKey($apiKey) { $this->api_key = $apiKey; return $this; } /** * Get api_secret. * * @return string */ public function getApiSecret() { return $this->api_secret; } /** * Set api_secret. * * @param string $apiSecret * * @return PasskeysAuthConfig */ public function setApiSecret($apiSecret) { $this->api_secret = $apiSecret; return $this; } /** * Get from phone number. * * @return string */ public function getFromPhoneNumber() { return $this->from_phone_number; } /** * Set from phone number. * * @param string $fromPhoneNumber * * @return PasskeysAuthConfig */ public function setFromPhoneNumber(string $fromPhoneNumber) { $this->from_phone_number = $fromPhoneNumber; return $this; } public function addIncludeRoute(string $route) { $routes = $this->getRoutes($this->getIncludeRoutes()); if (!in_array($route, $routes)) { $this->setIncludeRoutes($this->include_routes.PHP_EOL.$route); } return $this; } private function getRoutes(?string $routes): array { if (!$routes) { return []; } return explode(PHP_EOL, $routes); } /** * Get include_routes. * * @return string|null */ public function getIncludeRoutes() { return $this->include_routes; } /** * Set include_routes. * * @param string|null $include_routes * * @return PasskeysAuthConfig */ public function setIncludeRoutes($include_routes = null) { $this->include_routes = $include_routes; return $this; } public function removeIncludeRoute(string $route) { $routes = $this->getRoutes($this->getIncludeRoutes()); if (in_array($route, $routes)) { $routes = array_diff($routes, [$route]); $this->setIncludeRoutes($this->getRoutesAsString($routes)); } return $this; } private function getRoutesAsString(array $routes): string { return implode(PHP_EOL, $routes); } /** * @param string|null $plain_api_secret * * @return PasskeysAuthConfig */ public function setPlainApiSecret(?string $plain_api_secret): PasskeysAuthConfig { $this->plain_api_secret = $plain_api_secret; return $this; } /** * @return mixed */ public function getPlainApiSecret(): ?string { return $this->plain_api_secret; } }