55use Exception ;
66use GuzzleHttp \Client as HttpClient ;
77use GuzzleHTtp \Exception \ClientException ;
8+ use GuzzleHttp \Exception \GuzzleException ;
89use NotificationChannels \SMS77 \Exceptions \CouldNotSendNotification ;
910
1011class SMS77
1112{
1213 /**
1314 * @var string SMS77 API URL.
1415 */
15- protected string $ apiUrl = 'https://gateway.sms77 .io/api/ ' ;
16+ protected string $ apiUrl = 'https://gateway.seven .io/api/ ' ;
1617
17- /**
18- * @var HttpClient HTTP Client.
19- */
20- protected $ http ;
21-
22- /**
23- * @var null|string SMS77 API Key.
24- */
25- protected $ apiKey ;
2618
2719 /**
2820 * @param string $apiKey
2921 * @param HttpClient $http
3022 */
31- public function __construct (string $ apiKey = null , HttpClient $ http = null )
32- {
33- $ this -> apiKey = $ apiKey ;
34- $ this -> http = $ http ;
35- }
23+ public function __construct (
24+ protected string | null $ apiKey = null ,
25+ protected HttpClient | null $ http = null
26+ )
27+ { }
3628
3729 /**
3830 * Get API key.
@@ -49,8 +41,7 @@ public function getApiKey(): string
4941 *
5042 * @param string $apiKey
5143 */
52- public function setApiKey (string $ apiKey )
53- {
44+ public function setApiKey (string $ apiKey ): void {
5445 $ this ->apiKey = $ apiKey ;
5546 }
5647
@@ -72,7 +63,6 @@ protected function httpClient(): HttpClient
7263 * 'to' => '',
7364 * 'text' => '',
7465 * 'from' => '',
75- * 'debug' => '',
7666 * 'delay' => '',
7767 * 'no_reload' => '',
7868 * 'unicode' => '',
@@ -97,6 +87,10 @@ public function sendMessage(array $params)
9787 return $ this ->sendRequest ('sms ' , $ params );
9888 }
9989
90+ /**
91+ * @throws GuzzleException
92+ * @throws CouldNotSendNotification
93+ */
10094 public function sendRequest (string $ endpoint , array $ params )
10195 {
10296 if (empty ($ this ->apiKey )) {
0 commit comments