@@ -58,14 +58,14 @@ |
||
58 | 58 | [ |
59 | 59 | 'headers' => [ |
60 | 60 | 'Accept' => 'application/json', |
61 | - 'Authorization' => 'Bearer ' . $config->getApiToken(), |
|
61 | + 'Authorization' => 'Bearer '.$config->getApiToken(), |
|
62 | 62 | 'Content-Type' => 'application/json', |
63 | 63 | ], |
64 | 64 | 'json' => [ |
65 | 65 | 'body' => $message, |
66 | 66 | 'encoding' => 'plain', |
67 | 67 | 'originator' => 'Nextcloud', |
68 | - 'recipients' => [$identifier], |
|
68 | + 'recipients' => [ $identifier ], |
|
69 | 69 | 'route' => '1', |
70 | 70 | ], |
71 | 71 | ] |
@@ -74,7 +74,7 @@ |
||
74 | 74 | $body = $response->getBody(); |
75 | 75 | $json = json_decode($body, true); |
76 | 76 | |
77 | - if ($response->getStatusCode() !== 200 || is_null($json) || !is_array($json) || !isset($json['success']) || $json['success'] !== true) { |
|
77 | + if ($response->getStatusCode() !== 200 || is_null($json) || !is_array($json) || !isset($json[ 'success' ]) || $json[ 'success' ] !== true) { |
|
78 | 78 | $status = $response->getStatusCode(); |
79 | 79 | throw new SmsTransmissionException("error reported by Signal gateway, status=$status, body=$body}"); |
80 | 80 | } |
@@ -41,7 +41,7 @@ |
||
41 | 41 | } |
42 | 42 | |
43 | 43 | private function buildConfigKey(string $gatewayName, string $key) { |
44 | - return "$gatewayName" . "_$key"; |
|
44 | + return "$gatewayName"."_$key"; |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | private function getUserValue(IUser $user, string $gatewayName, string $key, $default = '') { |
@@ -52,11 +52,11 @@ |
||
52 | 52 | |
53 | 53 | protected function execute(InputInterface $input, OutputInterface $output) { |
54 | 54 | $signalConfigured = $this->signalGateway->getConfig()->isComplete(); |
55 | - $output->writeln('Signal gateway: ' . ($signalConfigured ? 'configured' : 'not configured')); |
|
55 | + $output->writeln('Signal gateway: '.($signalConfigured ? 'configured' : 'not configured')); |
|
56 | 56 | $smsConfigured = $this->smsGateway->getConfig()->isComplete(); |
57 | - $output->writeln('SMS gateway: ' . ($smsConfigured ? 'configured' : 'not configured')); |
|
57 | + $output->writeln('SMS gateway: '.($smsConfigured ? 'configured' : 'not configured')); |
|
58 | 58 | $telegramConfigured = $this->telegramGateway->getConfig()->isComplete(); |
59 | - $output->writeln('Telegram gateway: ' . ($telegramConfigured ? 'configured' : 'not configured')); |
|
59 | + $output->writeln('Telegram gateway: '.($telegramConfigured ? 'configured' : 'not configured')); |
|
60 | 60 | return 0; |
61 | 61 | } |
62 | 62 | } |
@@ -64,7 +64,7 @@ |
||
64 | 64 | protected $l10n; |
65 | 65 | |
66 | 66 | private function getSessionKey() { |
67 | - return "twofactor_gateway_" . $this->gatewayName . "_secret"; |
|
67 | + return "twofactor_gateway_".$this->gatewayName."_secret"; |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | public function __construct(string $gatewayId, |
@@ -33,6 +33,6 @@ |
||
33 | 33 | $length = strlen($number); |
34 | 34 | $start = $length - 3; |
35 | 35 | |
36 | - return str_repeat('*', $start) . substr($number, $start); |
|
36 | + return str_repeat('*', $start).substr($number, $start); |
|
37 | 37 | } |
38 | 38 | } |