@@ -13,7 +13,7 @@ |
||
| 13 | 13 | use OCP\IAppConfig; |
| 14 | 14 | |
| 15 | 15 | interface IProvider { |
| 16 | - public const SCHEMA = []; |
|
| 16 | + public const SCHEMA = [ ]; |
|
| 17 | 17 | |
| 18 | 18 | /** |
| 19 | 19 | * @param string $identifier |
@@ -20,27 +20,27 @@ |
||
| 20 | 20 | /** |
| 21 | 21 | * @throws MessageTransmissionException |
| 22 | 22 | */ |
| 23 | - #[\Override] |
|
| 23 | + #[\Override ] |
|
| 24 | 24 | abstract public function send(string $identifier, string $message); |
| 25 | 25 | |
| 26 | - #[\Override] |
|
| 26 | + #[\Override ] |
|
| 27 | 27 | public function setAppConfig(IAppConfig $appConfig): void { |
| 28 | 28 | $this->appConfig = $appConfig; |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | - #[\Override] |
|
| 31 | + #[\Override ] |
|
| 32 | 32 | public static function idOverride(): ?string { |
| 33 | 33 | return null; |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - #[\Override] |
|
| 36 | + #[\Override ] |
|
| 37 | 37 | public static function getProviderId(): string { |
| 38 | - if (static::SCHEMA['id'] ?? null) { |
|
| 39 | - return static::SCHEMA['id']; |
|
| 38 | + if (static::SCHEMA[ 'id' ] ?? null) { |
|
| 39 | + return static::SCHEMA[ 'id' ]; |
|
| 40 | 40 | } |
| 41 | 41 | $id = self::getIdFromProviderFqcn(static::class); |
| 42 | 42 | if ($id === null) { |
| 43 | - throw new \LogicException('Cannot derive gateway id from FQCN: ' . static::class); |
|
| 43 | + throw new \LogicException('Cannot derive gateway id from FQCN: '.static::class); |
|
| 44 | 44 | } |
| 45 | 45 | return $id; |
| 46 | 46 | } |
@@ -13,12 +13,12 @@ |
||
| 13 | 13 | |
| 14 | 14 | class Provider extends AProvider { |
| 15 | 15 | |
| 16 | - #[\Override] |
|
| 16 | + #[\Override ] |
|
| 17 | 17 | public function getDisplayName(): string { |
| 18 | 18 | return $this->l10n->t('Message gateway verification'); |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | - #[\Override] |
|
| 21 | + #[\Override ] |
|
| 22 | 22 | public function getDescription(): string { |
| 23 | 23 | return $this->l10n->t('Authenticate via SMS'); |
| 24 | 24 | } |
@@ -33,16 +33,16 @@ discard block |
||
| 33 | 33 | parent::__construct($appConfig); |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - #[\Override] |
|
| 37 | - public function send(IUser $user, string $identifier, string $message, array $extra = []): void { |
|
| 36 | + #[\Override ] |
|
| 37 | + public function send(IUser $user, string $identifier, string $message, array $extra = [ ]): void { |
|
| 38 | 38 | $this->getProvider()->send($identifier, $message); |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | - #[\Override] |
|
| 41 | + #[\Override ] |
|
| 42 | 42 | final public function cliConfigure(InputInterface $input, OutputInterface $output): int { |
| 43 | 43 | $namespaces = $this->providerFactory->getFqcnList(); |
| 44 | 44 | foreach ($namespaces as $ns) { |
| 45 | - $schemas[] = $ns::SCHEMA; |
|
| 45 | + $schemas[ ] = $ns::SCHEMA; |
|
| 46 | 46 | } |
| 47 | 47 | $names = array_column($schemas, 'name'); |
| 48 | 48 | |
@@ -50,32 +50,32 @@ discard block |
||
| 50 | 50 | $choiceQuestion = new ChoiceQuestion('Please choose a SMS provider:', $names); |
| 51 | 51 | $name = $helper->ask($input, $output, $choiceQuestion); |
| 52 | 52 | $selectedIndex = array_search($name, $names); |
| 53 | - $schema = $schemas[$selectedIndex]; |
|
| 53 | + $schema = $schemas[ $selectedIndex ]; |
|
| 54 | 54 | |
| 55 | - $provider = $this->getProvider($namespaces[$selectedIndex]::getProviderId()); |
|
| 55 | + $provider = $this->getProvider($namespaces[ $selectedIndex ]::getProviderId()); |
|
| 56 | 56 | |
| 57 | - foreach ($schema['fields'] as $field) { |
|
| 58 | - $id = $field['field']; |
|
| 59 | - $prompt = $field['prompt'] . ' '; |
|
| 60 | - $defaultVal = $field['default'] ?? null; |
|
| 61 | - $optional = (bool)($field['optional'] ?? false); |
|
| 57 | + foreach ($schema[ 'fields' ] as $field) { |
|
| 58 | + $id = $field[ 'field' ]; |
|
| 59 | + $prompt = $field[ 'prompt' ].' '; |
|
| 60 | + $defaultVal = $field[ 'default' ] ?? null; |
|
| 61 | + $optional = (bool)($field[ 'optional' ] ?? false); |
|
| 62 | 62 | |
| 63 | 63 | $answer = (string)$helper->ask($input, $output, new Question($prompt, $defaultVal)); |
| 64 | 64 | |
| 65 | 65 | if ($optional && $answer === '') { |
| 66 | - $method = 'delete' . $this->toCamel($id); |
|
| 66 | + $method = 'delete'.$this->toCamel($id); |
|
| 67 | 67 | $provider->{$method}(); |
| 68 | 68 | continue; |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | - $method = 'set' . $this->toCamel($id); |
|
| 71 | + $method = 'set'.$this->toCamel($id); |
|
| 72 | 72 | $provider->{$method}($answer); |
| 73 | 73 | } |
| 74 | 74 | return 0; |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | - #[\Override] |
|
| 78 | - public function isComplete(array $schema = []): bool { |
|
| 77 | + #[\Override ] |
|
| 78 | + public function isComplete(array $schema = [ ]): bool { |
|
| 79 | 79 | if (empty($schema)) { |
| 80 | 80 | try { |
| 81 | 81 | $provider = $this->getProvider(); |
@@ -87,8 +87,8 @@ discard block |
||
| 87 | 87 | return parent::isComplete($schema); |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | - #[\Override] |
|
| 91 | - public function remove(array $schema = []): void { |
|
| 90 | + #[\Override ] |
|
| 91 | + public function remove(array $schema = [ ]): void { |
|
| 92 | 92 | if (empty($schema)) { |
| 93 | 93 | $schema = static::SCHEMA; |
| 94 | 94 | } |
@@ -13,12 +13,12 @@ |
||
| 13 | 13 | |
| 14 | 14 | class Provider extends AProvider { |
| 15 | 15 | |
| 16 | - #[\Override] |
|
| 16 | + #[\Override ] |
|
| 17 | 17 | public function getDisplayName(): string { |
| 18 | 18 | return $this->l10n->t('XMPP verification'); |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | - #[\Override] |
|
| 21 | + #[\Override ] |
|
| 22 | 22 | public function getDescription(): string { |
| 23 | 23 | return $this->l10n->t('Authenticate via XMPP'); |
| 24 | 24 | } |
@@ -39,11 +39,11 @@ discard block |
||
| 39 | 39 | <p>Enter your JID (XMPP address) to receive your verification code below.</p> |
| 40 | 40 | HTML, |
| 41 | 41 | 'fields' => [ |
| 42 | - ['field' => 'sender', 'prompt' => 'Please enter your sender XMPP-JID:'], |
|
| 43 | - ['field' => 'password', 'prompt' => 'Please enter your sender XMPP password:'], |
|
| 44 | - ['field' => 'server', 'prompt' => 'Please enter full path to access REST/HTTP API:'], |
|
| 45 | - ['field' => 'username'], |
|
| 46 | - ['field' => 'method', 'prompt' => 'Please enter 1 or 2 for XMPP sending option:'], |
|
| 42 | + [ 'field' => 'sender', 'prompt' => 'Please enter your sender XMPP-JID:' ], |
|
| 43 | + [ 'field' => 'password', 'prompt' => 'Please enter your sender XMPP password:' ], |
|
| 44 | + [ 'field' => 'server', 'prompt' => 'Please enter full path to access REST/HTTP API:' ], |
|
| 45 | + [ 'field' => 'username' ], |
|
| 46 | + [ 'field' => 'method', 'prompt' => 'Please enter 1 or 2 for XMPP sending option:' ], |
|
| 47 | 47 | ], |
| 48 | 48 | ]; |
| 49 | 49 | |
@@ -54,8 +54,8 @@ discard block |
||
| 54 | 54 | parent::__construct($appConfig); |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | - #[\Override] |
|
| 58 | - public function send(IUser $user, string $identifier, string $message, array $extra = []): void { |
|
| 57 | + #[\Override ] |
|
| 58 | + public function send(IUser $user, string $identifier, string $message, array $extra = [ ]): void { |
|
| 59 | 59 | $this->logger->debug("sending xmpp message to $identifier, message: $message"); |
| 60 | 60 | |
| 61 | 61 | $sender = $this->getSender(); |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | $server = $this->getServer(); |
| 64 | 64 | $method = $this->getMethod(); |
| 65 | 65 | $user = $this->getUsername(); |
| 66 | - $url = $server . $identifier; |
|
| 66 | + $url = $server.$identifier; |
|
| 67 | 67 | |
| 68 | 68 | if ($method === '1') { |
| 69 | 69 | $from = $user; |
@@ -79,8 +79,8 @@ discard block |
||
| 79 | 79 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
| 80 | 80 | curl_setopt($ch, CURLOPT_POST, 1); |
| 81 | 81 | curl_setopt($ch, CURLOPT_POSTFIELDS, $message); |
| 82 | - curl_setopt($ch, CURLOPT_USERPWD, $from . ':' . $password); |
|
| 83 | - curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: text/plain']); |
|
| 82 | + curl_setopt($ch, CURLOPT_USERPWD, $from.':'.$password); |
|
| 83 | + curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'Content-Type: text/plain' ]); |
|
| 84 | 84 | $result = curl_exec($ch); |
| 85 | 85 | curl_close($ch); |
| 86 | 86 | $this->logger->debug("XMPP message to $identifier sent"); |
@@ -89,27 +89,27 @@ discard block |
||
| 89 | 89 | } |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | - #[\Override] |
|
| 92 | + #[\Override ] |
|
| 93 | 93 | public function cliConfigure(InputInterface $input, OutputInterface $output): int { |
| 94 | 94 | $helper = new QuestionHelper(); |
| 95 | - $fields = self::SCHEMA['fields']; |
|
| 95 | + $fields = self::SCHEMA[ 'fields' ]; |
|
| 96 | 96 | $fields = array_combine(array_column($fields, 'field'), $fields); |
| 97 | 97 | $sender = ''; |
| 98 | 98 | while (empty($sender) or substr_count($sender, '@') !== 1) { |
| 99 | - $senderQuestion = new Question($fields['sender']['prompt'] . ' '); |
|
| 99 | + $senderQuestion = new Question($fields[ 'sender' ][ 'prompt' ].' '); |
|
| 100 | 100 | $sender = $helper->ask($input, $output, $senderQuestion); |
| 101 | 101 | if (empty($sender)) { |
| 102 | 102 | $output->writeln('XMPP-JID must not be empty!'); |
| 103 | 103 | } elseif (substr_count($sender, '@') !== 1) { |
| 104 | 104 | $output->writeln('XMPP-JID not valid!'); |
| 105 | 105 | } else { |
| 106 | - $username = explode('@', $sender)[0]; |
|
| 106 | + $username = explode('@', $sender)[ 0 ]; |
|
| 107 | 107 | } |
| 108 | 108 | } |
| 109 | 109 | $output->writeln("Using $sender as XMPP-JID.\nUsing $username as username."); |
| 110 | 110 | $password = ''; |
| 111 | 111 | while (empty($password)) { |
| 112 | - $passwordQuestion = new Question($fields['password']['prompt'] . ' '); |
|
| 112 | + $passwordQuestion = new Question($fields[ 'password' ][ 'prompt' ].' '); |
|
| 113 | 113 | $password = $helper->ask($input, $output, $passwordQuestion); |
| 114 | 114 | if (empty($password)) { |
| 115 | 115 | $output->writeln('Password must not be empty!'); |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | $output->writeln('Password accepted.'); |
| 119 | 119 | $server = ''; |
| 120 | 120 | while (empty($server)) { |
| 121 | - $serverQuestion = new Question($fields['server']['prompt'] . ' '); |
|
| 121 | + $serverQuestion = new Question($fields[ 'server' ][ 'prompt' ].' '); |
|
| 122 | 122 | $server = $helper->ask($input, $output, $serverQuestion); |
| 123 | 123 | if (empty($server)) { |
| 124 | 124 | $output->writeln('API path must not be empty!'); |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | $output->writeln("Using $server as full URL to access REST/HTTP API."); |
| 128 | 128 | $method = 0; |
| 129 | 129 | while (intval($method) < 1 or intval($method) > 2) { |
| 130 | - echo $fields['method']['prompt'] . PHP_EOL; |
|
| 130 | + echo $fields[ 'method' ][ 'prompt' ].PHP_EOL; |
|
| 131 | 131 | echo "(1) prosody with mod_rest\n"; |
| 132 | 132 | echo "(2) prosody with mod_post_msg\n"; |
| 133 | 133 | $methodQuestion = new Question('Your choice: '); |
@@ -13,12 +13,12 @@ |
||
| 13 | 13 | |
| 14 | 14 | class Provider extends AProvider { |
| 15 | 15 | |
| 16 | - #[\Override] |
|
| 16 | + #[\Override ] |
|
| 17 | 17 | public function getDisplayName(): string { |
| 18 | 18 | return $this->l10n->t('WhatsApp verification'); |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | - #[\Override] |
|
| 21 | + #[\Override ] |
|
| 22 | 22 | public function getDescription(): string { |
| 23 | 23 | return $this->l10n->t('Authenticate via WhatsApp'); |
| 24 | 24 | } |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | public const SCHEMA = [ |
| 39 | 39 | 'name' => 'WhatsApp', |
| 40 | 40 | 'fields' => [ |
| 41 | - ['field' => 'base_url', 'prompt' => 'Base URL to your WhatsApp API endpoint:'], |
|
| 41 | + [ 'field' => 'base_url', 'prompt' => 'Base URL to your WhatsApp API endpoint:' ], |
|
| 42 | 42 | ], |
| 43 | 43 | ]; |
| 44 | 44 | private string $instanceId; |
@@ -56,25 +56,25 @@ discard block |
||
| 56 | 56 | $this->client = $this->clientService->newClient(); |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | - #[\Override] |
|
| 60 | - public function send(IUser $user, string $identifier, string $message, array $extra = []): void { |
|
| 61 | - $message = $this->l10n->t('`%s` is your Nextcloud verification code.', [$extra['code']]); |
|
| 59 | + #[\Override ] |
|
| 60 | + public function send(IUser $user, string $identifier, string $message, array $extra = [ ]): void { |
|
| 61 | + $message = $this->l10n->t('`%s` is your Nextcloud verification code.', [ $extra[ 'code' ] ]); |
|
| 62 | 62 | $this->logger->debug("sending whatsapp message to $identifier, message: $message"); |
| 63 | 63 | |
| 64 | 64 | $response = $this->getSessionStatus(); |
| 65 | 65 | if ($response !== 'CONNECTED') { |
| 66 | - throw new MessageTransmissionException('WhatsApp session is not connected. Current status: ' . $response); |
|
| 66 | + throw new MessageTransmissionException('WhatsApp session is not connected. Current status: '.$response); |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | $chatId = $this->getChatIdFromPhoneNumber($identifier); |
| 70 | 70 | |
| 71 | 71 | try { |
| 72 | - $response = $this->client->post($this->getBaseUrl() . '/client/sendMessage/' . $this->instanceId, [ |
|
| 72 | + $response = $this->client->post($this->getBaseUrl().'/client/sendMessage/'.$this->instanceId, [ |
|
| 73 | 73 | 'json' => [ |
| 74 | 74 | 'chatId' => $chatId, |
| 75 | 75 | 'contentType' => 'string', |
| 76 | 76 | 'content' => $message, |
| 77 | - 'options' => [], |
|
| 77 | + 'options' => [ ], |
|
| 78 | 78 | ], |
| 79 | 79 | ]); |
| 80 | 80 | } catch (\Exception $e) { |
@@ -88,10 +88,10 @@ discard block |
||
| 88 | 88 | $this->logger->debug("whatsapp message to chat $identifier sent"); |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | - #[\Override] |
|
| 91 | + #[\Override ] |
|
| 92 | 92 | public function cliConfigure(InputInterface $input, OutputInterface $output): int { |
| 93 | 93 | $helper = new QuestionHelper(); |
| 94 | - $baseUrlQuestion = new Question(self::SCHEMA['fields'][0]['prompt'] . ' '); |
|
| 94 | + $baseUrlQuestion = new Question(self::SCHEMA[ 'fields' ][ 0 ][ 'prompt' ].' '); |
|
| 95 | 95 | $this->lazyBaseUrl = $helper->ask($input, $output, $baseUrlQuestion); |
| 96 | 96 | $this->lazyBaseUrl = rtrim($this->lazyBaseUrl, '/'); |
| 97 | 97 | |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | return 1; |
| 101 | 101 | } |
| 102 | 102 | } catch (\Exception $e) { |
| 103 | - $output->writeln('<error>' . $e->getMessage() . '</error>'); |
|
| 103 | + $output->writeln('<error>'.$e->getMessage().'</error>'); |
|
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | $this->setBaseUrl($this->lazyBaseUrl); |
@@ -110,23 +110,23 @@ discard block |
||
| 110 | 110 | |
| 111 | 111 | private function getChatIdFromPhoneNumber(string $phoneNumber): string { |
| 112 | 112 | try { |
| 113 | - $response = $this->client->post($this->getBaseUrl() . '/client/getNumberId/' . $this->instanceId, [ |
|
| 113 | + $response = $this->client->post($this->getBaseUrl().'/client/getNumberId/'.$this->instanceId, [ |
|
| 114 | 114 | 'json' => [ |
| 115 | 115 | 'number' => preg_replace('/\D/', '', $phoneNumber), |
| 116 | 116 | ], |
| 117 | 117 | ]); |
| 118 | 118 | $json = $response->getBody(); |
| 119 | 119 | $data = json_decode($json, true); |
| 120 | - if (empty($data['result'])) { |
|
| 120 | + if (empty($data[ 'result' ])) { |
|
| 121 | 121 | throw new MessageTransmissionException('The phone number is not registered on WhatsApp.'); |
| 122 | 122 | } |
| 123 | - return $data['result']['_serialized']; |
|
| 123 | + return $data[ 'result' ][ '_serialized' ]; |
|
| 124 | 124 | } catch (ServerException $e) { |
| 125 | 125 | $content = $e->getResponse()?->getBody()?->getContents(); |
| 126 | 126 | if ($content === null) { |
| 127 | 127 | throw new MessageTransmissionException('Unknown error'); |
| 128 | 128 | } |
| 129 | - $errorMessage = json_decode($content, true)['error'] ?? 'Unknown error'; |
|
| 129 | + $errorMessage = json_decode($content, true)[ 'error' ] ?? 'Unknown error'; |
|
| 130 | 130 | throw new MessageTransmissionException($errorMessage); |
| 131 | 131 | } |
| 132 | 132 | } |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | /** @var string */ |
| 143 | - $this->lazyBaseUrl = $this->__call(__FUNCTION__, []); |
|
| 143 | + $this->lazyBaseUrl = $this->__call(__FUNCTION__, [ ]); |
|
| 144 | 144 | return $this->lazyBaseUrl; |
| 145 | 145 | } |
| 146 | 146 | |
@@ -156,19 +156,19 @@ discard block |
||
| 156 | 156 | |
| 157 | 157 | $last = null; |
| 158 | 158 | while (true) { |
| 159 | - $response = $this->client->get($this->getBaseUrl() . '/session/qr/' . $this->instanceId); |
|
| 159 | + $response = $this->client->get($this->getBaseUrl().'/session/qr/'.$this->instanceId); |
|
| 160 | 160 | $json = $response->getBody(); |
| 161 | 161 | $data = json_decode($json, true); |
| 162 | - if ($data['success'] === false) { |
|
| 163 | - if ($data['message'] === 'qr code not ready or already scanned') { |
|
| 162 | + if ($data[ 'success' ] === false) { |
|
| 163 | + if ($data[ 'message' ] === 'qr code not ready or already scanned') { |
|
| 164 | 164 | $output->writeln('<error>Session not connected yet, waiting...</error>'); |
| 165 | 165 | sleep(2); |
| 166 | 166 | continue; |
| 167 | 167 | } |
| 168 | - $output->writeln('<error>' . $data['message'] . '</error>'); |
|
| 168 | + $output->writeln('<error>'.$data[ 'message' ].'</error>'); |
|
| 169 | 169 | return 1; |
| 170 | 170 | } |
| 171 | - $qrCodeContent = $data['qr']; |
|
| 171 | + $qrCodeContent = $data[ 'qr' ]; |
|
| 172 | 172 | |
| 173 | 173 | if ($qrCodeContent !== $last) { |
| 174 | 174 | $last = $qrCodeContent; |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 | private function getSessionStatus(): string { |
| 193 | - $endpoint = $this->getBaseUrl() . '/session/status/' . $this->instanceId; |
|
| 193 | + $endpoint = $this->getBaseUrl().'/session/status/'.$this->instanceId; |
|
| 194 | 194 | |
| 195 | 195 | try { |
| 196 | 196 | $response = $this->client->get($endpoint); |
@@ -201,18 +201,18 @@ discard block |
||
| 201 | 201 | return 'not_connected'; |
| 202 | 202 | } |
| 203 | 203 | |
| 204 | - if (($responseData['success'] ?? null) === false) { |
|
| 205 | - $msg = $responseData['message'] ?? ''; |
|
| 206 | - return in_array($msg, ['session_not_found', 'session_not_connected'], true) |
|
| 204 | + if (($responseData[ 'success' ] ?? null) === false) { |
|
| 205 | + $msg = $responseData[ 'message' ] ?? ''; |
|
| 206 | + return in_array($msg, [ 'session_not_found', 'session_not_connected' ], true) |
|
| 207 | 207 | ? $msg |
| 208 | 208 | : 'not_connected'; |
| 209 | 209 | } |
| 210 | 210 | |
| 211 | - return (string)($responseData['state'] ?? 'not_connected'); |
|
| 211 | + return (string)($responseData[ 'state' ] ?? 'not_connected'); |
|
| 212 | 212 | } catch (ClientException $e) { |
| 213 | 213 | return 'not_connected'; |
| 214 | 214 | } catch (RequestException $e) { |
| 215 | - $this->logger->info('Could not connect to ' . $endpoint, ['exception' => $e]); |
|
| 215 | + $this->logger->info('Could not connect to '.$endpoint, [ 'exception' => $e ]); |
|
| 216 | 216 | throw new \Exception('Could not connect to the WhatsApp API. Please check the URL.', 1); |
| 217 | 217 | } |
| 218 | 218 | } |
@@ -231,13 +231,13 @@ discard block |
||
| 231 | 231 | } |
| 232 | 232 | |
| 233 | 233 | private function getSessionStart(): int { |
| 234 | - $endpoint = $this->getBaseUrl() . '/session/start/' . $this->instanceId; |
|
| 234 | + $endpoint = $this->getBaseUrl().'/session/start/'.$this->instanceId; |
|
| 235 | 235 | try { |
| 236 | 236 | $this->client->get($endpoint); |
| 237 | 237 | } catch (ClientException $e) { |
| 238 | 238 | return 1; |
| 239 | 239 | } catch (RequestException $e) { |
| 240 | - $this->logger->info('Could not connect to ' . $endpoint, [ |
|
| 240 | + $this->logger->info('Could not connect to '.$endpoint, [ |
|
| 241 | 241 | 'exception' => $e, |
| 242 | 242 | ]); |
| 243 | 243 | throw new \Exception('Could not connect to the WhatsApp API. Please check the URL.', 1); |
@@ -13,12 +13,12 @@ |
||
| 13 | 13 | |
| 14 | 14 | class Provider extends AProvider { |
| 15 | 15 | |
| 16 | - #[\Override] |
|
| 16 | + #[\Override ] |
|
| 17 | 17 | public function getDisplayName(): string { |
| 18 | 18 | return $this->l10n->t('Telegram verification'); |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | - #[\Override] |
|
| 21 | + #[\Override ] |
|
| 22 | 22 | public function getDescription(): string { |
| 23 | 23 | return $this->l10n->t('Authenticate via Telegram'); |
| 24 | 24 | } |