From e56fa2e8d04b7a3159c9407617cd2a964f53c16b Mon Sep 17 00:00:00 2001 From: Steven Clouston Date: Mon, 9 Dec 2024 09:56:48 +1300 Subject: [PATCH] Rename setApiHostname to setApiUrl --- README.md | 4 ++-- lib/Authsignal/Authsignal.php | 6 +++--- lib/Authsignal/AuthsignalClient.php | 2 +- test/AuthsignalTest.php | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index aefdee7..231347a 100644 --- a/README.md +++ b/README.md @@ -33,12 +33,12 @@ Authsignal has multiple api hosting regions. To view your hostname for your tena | AU (Sydney) | https://au.signal.authsignal.com/v1 | | EU (Dublin) | https://eu.signal.authsignal.com/v1 | -You can set the hostname via the following code. If the `setApiHostname` function is not called, the api call defaults to the main Authsignal US region hostname `https://signal.authsignal.com` +You can set the hostname via the following code. If the `setApiUrl` function is not called, the api call defaults to the main Authsignal US region hostname `https://signal.authsignal.com` An example setting the client to use the AU region. ```php -Authsignal::setApiHostname("https://au.signal.authsignal.com"); +Authsignal::setApiUrl("https://au.signal.authsignal.com"); ``` Alternatively, an environment variable can be used to set the API URL: diff --git a/lib/Authsignal/Authsignal.php b/lib/Authsignal/Authsignal.php index fefb4e1..4dd67c3 100644 --- a/lib/Authsignal/Authsignal.php +++ b/lib/Authsignal/Authsignal.php @@ -9,7 +9,7 @@ abstract class Authsignal public static $apiSecretKey; - public static $apiHostname = 'https://signal.authsignal.com'; + public static $apiUrl = 'https://signal.authsignal.com'; public static $apiVersion = 'v1'; @@ -29,9 +29,9 @@ public static function setApiSecretKey($apiSecretKey) self::$apiSecretKey = $apiSecretKey; } - public static function setApiHostname($hostname) + public static function setApiUrl($apiUrl) { - self::$apiHostname = $hostname; + self::$apiUrl = $apiUrl; } public static function setCurlOpts($curlOpts) diff --git a/lib/Authsignal/AuthsignalClient.php b/lib/Authsignal/AuthsignalClient.php index 95c3a41..3559161 100644 --- a/lib/Authsignal/AuthsignalClient.php +++ b/lib/Authsignal/AuthsignalClient.php @@ -6,7 +6,7 @@ public static function apiUrl($path='') { $apiEndpoint = getenv('AUTHSIGNAL_SERVER_API_ENDPOINT'); if ( !$apiEndpoint ) { - $apiURL = Authsignal::$apiHostname; + $apiURL = Authsignal::$apiUrl; $apiVersion = Authsignal::getApiVersion(); $apiEndpoint = $apiURL.'/'.$apiVersion; } diff --git a/test/AuthsignalTest.php b/test/AuthsignalTest.php index 2093f2c..859e9ca 100644 --- a/test/AuthsignalTest.php +++ b/test/AuthsignalTest.php @@ -15,7 +15,7 @@ public static function setUpBeforeClass(): void { self::$server = new MockWebServer; self::$server->start(); - Authsignal::setApiHostname(self::$server->getServerRoot()); + Authsignal::setApiUrl(self::$server->getServerRoot()); } static function tearDownAfterClass(): void {