@@ -27,9 +27,9 @@ discard block |
||
27 | 27 | public const SCHEMA = [ |
28 | 28 | 'name' => 'SMSGlobal', |
29 | 29 | 'fields' => [ |
30 | - ['field' => 'url', 'prompt' => 'Please enter your SMSGlobal http-api:', 'default' => 'https://api.smsglobal.com/http-api.php'], |
|
31 | - ['field' => 'user', 'prompt' => 'Please enter your SMSGlobal username (for http-api):'], |
|
32 | - ['field' => 'password', 'prompt' => 'Please enter your SMSGlobal password (for http-api):'], |
|
30 | + [ 'field' => 'url', 'prompt' => 'Please enter your SMSGlobal http-api:', 'default' => 'https://api.smsglobal.com/http-api.php' ], |
|
31 | + [ 'field' => 'user', 'prompt' => 'Please enter your SMSGlobal username (for http-api):' ], |
|
32 | + [ 'field' => 'password', 'prompt' => 'Please enter your SMSGlobal password (for http-api):' ], |
|
33 | 33 | ], |
34 | 34 | ]; |
35 | 35 | private IClient $client; |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | $this->client = $clientService->newClient(); |
41 | 41 | } |
42 | 42 | |
43 | - #[\Override] |
|
43 | + #[\Override ] |
|
44 | 44 | public function send(string $identifier, string $message) { |
45 | 45 | $to = str_replace('+', '', $identifier); |
46 | 46 |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | public const SCHEMA = [ |
24 | 24 | 'name' => 'Spryng', |
25 | 25 | 'fields' => [ |
26 | - ['field' => 'apitoken', 'prompt' => 'Please enter your Spryng api token:'], |
|
26 | + [ 'field' => 'apitoken', 'prompt' => 'Please enter your Spryng api token:' ], |
|
27 | 27 | ], |
28 | 28 | ]; |
29 | 29 | private IClient $client; |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | $this->client = $clientService->newClient(); |
35 | 35 | } |
36 | 36 | |
37 | - #[\Override] |
|
37 | + #[\Override ] |
|
38 | 38 | public function send(string $identifier, string $message) { |
39 | 39 | try { |
40 | 40 | $this->client->post( |
@@ -42,14 +42,14 @@ discard block |
||
42 | 42 | [ |
43 | 43 | 'headers' => [ |
44 | 44 | 'Accept' => 'application/json', |
45 | - 'Authorization' => 'Bearer ' . $this->getApitoken(), |
|
45 | + 'Authorization' => 'Bearer '.$this->getApitoken(), |
|
46 | 46 | 'Content-Type' => 'application/json', |
47 | 47 | ], |
48 | 48 | 'json' => [ |
49 | 49 | 'body' => $message, |
50 | 50 | 'encoding' => 'plain', |
51 | 51 | 'originator' => 'Nextcloud', |
52 | - 'recipients' => [$identifier], |
|
52 | + 'recipients' => [ $identifier ], |
|
53 | 53 | 'route' => '1', |
54 | 54 | ], |
55 | 55 | ] |
@@ -26,8 +26,8 @@ discard block |
||
26 | 26 | 'id' => 'websms_de', |
27 | 27 | 'name' => 'WebSMS.de', |
28 | 28 | 'fields' => [ |
29 | - ['field' => 'user', 'prompt' => 'Please enter your websms.de username:'], |
|
30 | - ['field' => 'password', 'prompt' => 'Please enter your websms.de password:'], |
|
29 | + [ 'field' => 'user', 'prompt' => 'Please enter your websms.de username:' ], |
|
30 | + [ 'field' => 'password', 'prompt' => 'Please enter your websms.de password:' ], |
|
31 | 31 | ], |
32 | 32 | ]; |
33 | 33 | private IClient $client; |
@@ -38,20 +38,20 @@ discard block |
||
38 | 38 | $this->client = $clientService->newClient(); |
39 | 39 | } |
40 | 40 | |
41 | - #[\Override] |
|
41 | + #[\Override ] |
|
42 | 42 | public function send(string $identifier, string $message) { |
43 | 43 | $user = $this->getUser(); |
44 | 44 | $password = $this->getPassword(); |
45 | 45 | try { |
46 | 46 | $this->client->post('https://api.websms.com/rest/smsmessaging/text', [ |
47 | 47 | 'headers' => [ |
48 | - 'Authorization' => 'Basic ' . base64_encode("$user:$password"), |
|
48 | + 'Authorization' => 'Basic '.base64_encode("$user:$password"), |
|
49 | 49 | 'Content-Type' => 'application/json', |
50 | 50 | ], |
51 | 51 | 'json' => [ |
52 | 52 | 'messageContent' => $message, |
53 | 53 | 'test' => false, |
54 | - 'recipientAddressList' => [$identifier], |
|
54 | + 'recipientAddressList' => [ $identifier ], |
|
55 | 55 | ], |
56 | 56 | ]); |
57 | 57 | } catch (Exception $ex) { |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | 'id' => 'huawei_e3531', |
25 | 25 | 'name' => 'Huawei E3531', |
26 | 26 | 'fields' => [ |
27 | - ['field' => 'api', 'prompt' => 'Please enter the base URL of the Huawei E3531 stick: ', 'default' => 'http://192.168.8.1/api'], |
|
27 | + [ 'field' => 'api', 'prompt' => 'Please enter the base URL of the Huawei E3531 stick: ', 'default' => 'http://192.168.8.1/api' ], |
|
28 | 28 | ], |
29 | 29 | ]; |
30 | 30 | private IClient $client; |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | $this->client = $clientService->newClient(); |
36 | 36 | } |
37 | 37 | |
38 | - #[\Override] |
|
38 | + #[\Override ] |
|
39 | 39 | public function send(string $identifier, string $message) { |
40 | 40 | $url = $this->getApi(); |
41 | 41 |
@@ -25,8 +25,8 @@ discard block |
||
25 | 25 | public const SCHEMA = [ |
26 | 26 | 'name' => 'SMSAPI', |
27 | 27 | 'fields' => [ |
28 | - ['field' => 'token', 'prompt' => 'Please enter your SMSApi.com API token:'], |
|
29 | - ['field' => 'sender','prompt' => 'Please enter your SMSApi.com sender name:'], |
|
28 | + [ 'field' => 'token', 'prompt' => 'Please enter your SMSApi.com API token:' ], |
|
29 | + [ 'field' => 'sender', 'prompt' => 'Please enter your SMSApi.com sender name:' ], |
|
30 | 30 | ], |
31 | 31 | ]; |
32 | 32 | private IClient $client; |
@@ -37,17 +37,17 @@ discard block |
||
37 | 37 | $this->client = $clientService->newClient(); |
38 | 38 | } |
39 | 39 | |
40 | - #[\Override] |
|
40 | + #[\Override ] |
|
41 | 41 | public function send(string $identifier, string $message) { |
42 | 42 | $sender = $this->getSender(); |
43 | 43 | $token = $this->getToken(); |
44 | 44 | $url = 'https://api.smsapi.com/sms.do'; |
45 | 45 | |
46 | 46 | $params = [ |
47 | - 'to' => $identifier, //destination number |
|
48 | - 'from' => $sender, //sendername made in https://ssl.smsapi.com/sms_settings/sendernames |
|
49 | - 'message' => $message, //message content |
|
50 | - 'format' => 'json', //get response in json format |
|
47 | + 'to' => $identifier, //destination number |
|
48 | + 'from' => $sender, //sendername made in https://ssl.smsapi.com/sms_settings/sendernames |
|
49 | + 'message' => $message, //message content |
|
50 | + 'format' => 'json', //get response in json format |
|
51 | 51 | ]; |
52 | 52 | |
53 | 53 | try { |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | curl_close($c); |
72 | 72 | $responseData = json_decode($content, true); |
73 | 73 | |
74 | - if ($responseData['count'] !== 1) { |
|
74 | + if ($responseData[ 'count' ] !== 1) { |
|
75 | 75 | throw new MessageTransmissionException(); |
76 | 76 | } |
77 | 77 | } catch (Exception $ex) { |
@@ -27,9 +27,9 @@ discard block |
||
27 | 27 | public const SCHEMA = [ |
28 | 28 | 'name' => 'VoIP.ms', |
29 | 29 | 'fields' => [ |
30 | - ['field' => 'api_user', 'prompt' => 'Please enter your VoIP.ms API username:'], |
|
31 | - ['field' => 'api_password', 'prompt' => 'Please enter your VoIP.ms API password:'], |
|
32 | - ['field' => 'did', 'prompt' => 'Please enter your VoIP.ms DID:'], |
|
30 | + [ 'field' => 'api_user', 'prompt' => 'Please enter your VoIP.ms API username:' ], |
|
31 | + [ 'field' => 'api_password', 'prompt' => 'Please enter your VoIP.ms API password:' ], |
|
32 | + [ 'field' => 'did', 'prompt' => 'Please enter your VoIP.ms DID:' ], |
|
33 | 33 | ], |
34 | 34 | ]; |
35 | 35 | private IClient $client; |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | $this->client = $clientService->newClient(); |
41 | 41 | } |
42 | 42 | |
43 | - #[\Override] |
|
43 | + #[\Override ] |
|
44 | 44 | public function send(string $identifier, string $message) { |
45 | 45 | $user = $this->getApiUser(); |
46 | 46 | $password = $this->getApiPassword(); |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | public const SCHEMA = [ |
24 | 24 | 'name' => 'sms77.io', |
25 | 25 | 'fields' => [ |
26 | - ['field' => 'api_key', 'prompt' => 'Please enter your sms77.io API key:'], |
|
26 | + [ 'field' => 'api_key', 'prompt' => 'Please enter your sms77.io API key:' ], |
|
27 | 27 | ], |
28 | 28 | ]; |
29 | 29 | private IClient $client; |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | $this->client = $clientService->newClient(); |
35 | 35 | } |
36 | 36 | |
37 | - #[\Override] |
|
37 | + #[\Override ] |
|
38 | 38 | public function send(string $identifier, string $message) { |
39 | 39 | $apiKey = $this->getApiKey(); |
40 | 40 | try { |
@@ -27,8 +27,8 @@ discard block |
||
27 | 27 | 'id' => 'clickatell_portal', |
28 | 28 | 'name' => 'Clickatell Portal', |
29 | 29 | 'fields' => [ |
30 | - ['field' => 'apikey', 'prompt' => 'Please enter your portal.clickatell.com API-Key:'], |
|
31 | - ['field' => 'from', 'prompt' => 'Please enter your sender number for two-way messaging (empty = one-way): ', 'optional' => true], |
|
30 | + [ 'field' => 'apikey', 'prompt' => 'Please enter your portal.clickatell.com API-Key:' ], |
|
31 | + [ 'field' => 'from', 'prompt' => 'Please enter your sender number for two-way messaging (empty = one-way): ', 'optional' => true ], |
|
32 | 32 | ], |
33 | 33 | ]; |
34 | 34 | private IClient $client; |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | $this->client = $clientService->newClient(); |
40 | 40 | } |
41 | 41 | |
42 | - #[\Override] |
|
42 | + #[\Override ] |
|
43 | 43 | public function send(string $identifier, string $message) { |
44 | 44 | try { |
45 | 45 | $from = $this->getFrom(); |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | public const SCHEMA = [ |
24 | 24 | 'name' => 'ClockworkSMS', |
25 | 25 | 'fields' => [ |
26 | - ['field' => 'apitoken', 'prompot' => 'Please enter your clockworksms api token:'], |
|
26 | + [ 'field' => 'apitoken', 'prompot' => 'Please enter your clockworksms api token:' ], |
|
27 | 27 | ] |
28 | 28 | ]; |
29 | 29 | private IClient $client; |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | $this->client = $clientService->newClient(); |
35 | 35 | } |
36 | 36 | |
37 | - #[\Override] |
|
37 | + #[\Override ] |
|
38 | 38 | public function send(string $identifier, string $message) { |
39 | 39 | try { |
40 | 40 | $response = $this->client->get( |