@@ -43,12 +43,12 @@ class UrlBuilder
4343
4444 private string $ secret ;
4545
46- private string $ serverBaseUrl ;
46+ private string $ baseUrl ;
4747
48- public function __construct (string $ secret , string $ serverBaseUrl , string $ hashingAlgorithm )
48+ public function __construct (string $ secret , string $ baseUrl , string $ hashingAlgorithm )
4949 {
5050 $ this ->setSecret ($ secret );
51- $ this ->setServerBaseUrl ( $ serverBaseUrl );
51+ $ this ->setBaseUrl ( $ baseUrl );
5252 $ this ->setHashingAlgorithm ($ hashingAlgorithm );
5353 }
5454
@@ -60,28 +60,18 @@ public function setSecret(string $secret): self
6060 return $ this ;
6161 }
6262
63- public function getSecret (): string
64- {
65- return $ this ->secret ;
66- }
67-
68- public function setServerBaseUrl (string $ serverBaseUrl ): self
63+ public function setBaseUrl (string $ baseUrl ): self
6964 {
7065 // add tailing dir-separator if missing
71- if ('/ ' != mb_substr ($ serverBaseUrl , -1 )) {
72- $ serverBaseUrl .= '/ ' ;
66+ if ('/ ' != mb_substr ($ baseUrl , -1 )) {
67+ $ baseUrl .= '/ ' ;
7368 }
7469
75- $ this ->serverBaseUrl = $ serverBaseUrl ;
70+ $ this ->baseUrl = $ baseUrl ;
7671
7772 return $ this ;
7873 }
7974
80- public function getServerBaseUrl (): string
81- {
82- return $ this ->serverBaseUrl ;
83- }
84-
8575 public function setHashingAlgorithm (string $ hashingAlgorithm ): self
8676 {
8777 $ this ->hashingAlgorithm = $ hashingAlgorithm ;
@@ -100,7 +90,7 @@ public function getHashingAlgorithm(): string
10090 */
10191 public function buildUrl (string $ method = '' , string $ params = '' , bool $ append = true ): string
10292 {
103- return $ this ->serverBaseUrl . 'api/ ' . $ method . ($ append ? '? ' . $ this ->buildQs ($ method , $ params ) : '' );
93+ return $ this ->baseUrl . 'api/ ' . $ method . ($ append ? '? ' . $ this ->buildQs ($ method , $ params ) : '' );
10494 }
10595
10696 /**
0 commit comments