@@ -35,14 +35,14 @@ |
||
| 35 | 35 | */ |
| 36 | 36 | trait ConfigMethodsTrait |
| 37 | 37 | { |
| 38 | - /** |
|
| 39 | - * Parse the POST fields and set them into configuration data structure. |
|
| 40 | - * Used for saveConfig method only. |
|
| 41 | - * |
|
| 42 | - * @param array $postParams |
|
| 43 | - * |
|
| 44 | - * @return void |
|
| 45 | - */ |
|
| 38 | + /** |
|
| 39 | + * Parse the POST fields and set them into configuration data structure. |
|
| 40 | + * Used for saveConfig method only. |
|
| 41 | + * |
|
| 42 | + * @param array $postParams |
|
| 43 | + * |
|
| 44 | + * @return void |
|
| 45 | + */ |
|
| 46 | 46 | protected function saveConfigPrepareSettings(array $postParams): void |
| 47 | 47 | { |
| 48 | 48 | foreach ($postParams as $postKey => $postData) { |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | } else { |
| 78 | 78 | if (is_numeric($postData)) { |
| 79 | 79 | $this->setConfig(str_replace('__', '.', $postKey), (int) $postData); |
| 80 | - } else { |
|
| 80 | + } else { |
|
| 81 | 81 | $this->setConfig(str_replace('__', '.', $postKey), $postData); |
| 82 | 82 | } |
| 83 | 83 | } |
@@ -165,10 +165,10 @@ discard block |
||
| 165 | 165 | // Create default log files. |
| 166 | 166 | if (is_writable($iptablesWatchingFolder)) { |
| 167 | 167 | fopen($iptablesWatchingFolder . '/iptables_queue.log', 'w+'); |
| 168 | - fopen($iptablesWatchingFolder . '/ipv4_status.log', 'w+'); |
|
| 169 | - fopen($iptablesWatchingFolder . '/ipv6_status.log', 'w+'); |
|
| 170 | - fopen($iptablesWatchingFolder . '/ipv4_command.log', 'w+'); |
|
| 171 | - fopen($iptablesWatchingFolder . '/ipv6_command.log', 'w+'); |
|
| 168 | + fopen($iptablesWatchingFolder . '/ipv4_status.log', 'w+'); |
|
| 169 | + fopen($iptablesWatchingFolder . '/ipv6_status.log', 'w+'); |
|
| 170 | + fopen($iptablesWatchingFolder . '/ipv4_command.log', 'w+'); |
|
| 171 | + fopen($iptablesWatchingFolder . '/ipv6_command.log', 'w+'); |
|
| 172 | 172 | } |
| 173 | 173 | } |
| 174 | 174 | |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | (string) $db['user'], |
| 247 | 247 | (string) $db['pass'] |
| 248 | 248 | ); |
| 249 | - } catch(PDOException $e) { |
|
| 249 | + } catch (PDOException $e) { |
|
| 250 | 250 | $result = false; |
| 251 | 251 | $this->pushMessage('error', |
| 252 | 252 | __( |
@@ -299,7 +299,7 @@ discard block |
||
| 299 | 299 | if (class_exists('PDO')) { |
| 300 | 300 | try { |
| 301 | 301 | new PDO('sqlite:' . $sqliteFilePath); |
| 302 | - } catch(PDOException $e) { |
|
| 302 | + } catch (PDOException $e) { |
|
| 303 | 303 | $this->pushMessage('error', $e->getMessage()); |
| 304 | 304 | $result = false; |
| 305 | 305 | } |
@@ -341,10 +341,10 @@ discard block |
||
| 341 | 341 | $redis = new Redis(); |
| 342 | 342 | $redis->connect( |
| 343 | 343 | (string) $this->getConfig('drivers.redis.host'), |
| 344 | - (int) $this->getConfig('drivers.redis.port') |
|
| 344 | + (int) $this->getConfig('drivers.redis.port') |
|
| 345 | 345 | ); |
| 346 | 346 | unset($redis); |
| 347 | - } catch(RedisException $e) { |
|
| 347 | + } catch (RedisException $e) { |
|
| 348 | 348 | $this->pushMessage('error', $e->getMessage()); |
| 349 | 349 | $result = false; |
| 350 | 350 | } |
@@ -44,7 +44,7 @@ |
||
| 44 | 44 | |
| 45 | 45 | // @codeCoverageIgnoreStart |
| 46 | 46 | |
| 47 | - } catch(PDOException $e) { |
|
| 47 | + } catch (PDOException $e) { |
|
| 48 | 48 | echo $e->getMessage(); |
| 49 | 49 | } |
| 50 | 50 | |
@@ -60,7 +60,7 @@ |
||
| 60 | 60 | |
| 61 | 61 | // @codeCoverageIgnoreStart |
| 62 | 62 | |
| 63 | - } catch(RedisException $e) { |
|
| 63 | + } catch (RedisException $e) { |
|
| 64 | 64 | echo $e->getMessage(); |
| 65 | 65 | } |
| 66 | 66 | |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | public static function get(array $setting): MessengerInterface |
| 31 | 31 | { |
| 32 | 32 | $botToken = $setting['config']['bot_token'] ?? ''; |
| 33 | - $channel = $setting['config']['channel'] ?? ''; |
|
| 33 | + $channel = $setting['config']['channel'] ?? ''; |
|
| 34 | 34 | |
| 35 | 35 | return new Slack($botToken, $channel); |
| 36 | 36 | } |
@@ -30,10 +30,10 @@ |
||
| 30 | 30 | */ |
| 31 | 31 | public static function get(array $setting): MessengerInterface |
| 32 | 32 | { |
| 33 | - $apiKey = $setting['config']['api_key'] ?? ''; |
|
| 33 | + $apiKey = $setting['config']['api_key'] ?? ''; |
|
| 34 | 34 | $domain = $setting['config']['domain_name'] ?? ''; |
| 35 | - $sender = $setting['config']['sender'] ?? ''; |
|
| 36 | - $recipients = $setting['config']['recipients'] ?? []; |
|
| 35 | + $sender = $setting['config']['sender'] ?? ''; |
|
| 36 | + $recipients = $setting['config']['recipients'] ?? []; |
|
| 37 | 37 | |
| 38 | 38 | $instance = new Mailgun($apiKey, $domain); |
| 39 | 39 | $instance->setSubject(__('core', 'messenger_text_mail_subject')); |
@@ -30,11 +30,11 @@ |
||
| 30 | 30 | */ |
| 31 | 31 | public static function get(array $setting): MessengerInterface |
| 32 | 32 | { |
| 33 | - $sender = $setting['config']['sender'] ?? ''; |
|
| 33 | + $sender = $setting['config']['sender'] ?? ''; |
|
| 34 | 34 | $recipients = $setting['config']['recipients'] ?? []; |
| 35 | - $host = $setting['config']['host'] ?? ''; |
|
| 36 | - $user = $setting['config']['user'] ?? ''; |
|
| 37 | - $pass = $setting['config']['pass'] ?? ''; |
|
| 35 | + $host = $setting['config']['host'] ?? ''; |
|
| 36 | + $user = $setting['config']['user'] ?? ''; |
|
| 37 | + $pass = $setting['config']['pass'] ?? ''; |
|
| 38 | 38 | $port = $setting['config']['port'] ?? ''; |
| 39 | 39 | |
| 40 | 40 | $instance = new Smtp($user, $pass, $host, (int) $port); |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | */ |
| 31 | 31 | public static function get(array $setting): MessengerInterface |
| 32 | 32 | { |
| 33 | - $sender = $setting['config']['sender'] ?? ''; |
|
| 33 | + $sender = $setting['config']['sender'] ?? ''; |
|
| 34 | 34 | $recipients = $setting['config']['recipients'] ?? []; |
| 35 | 35 | |
| 36 | 36 | $instance = new Mail(); |
@@ -29,10 +29,10 @@ |
||
| 29 | 29 | */ |
| 30 | 30 | public static function get(array $setting): MessengerInterface |
| 31 | 31 | { |
| 32 | - $serverUrl = $setting['config']['server_url'] ?? ''; |
|
| 33 | - $userId = $setting['config']['user_id'] ?? ''; |
|
| 32 | + $serverUrl = $setting['config']['server_url'] ?? ''; |
|
| 33 | + $userId = $setting['config']['user_id'] ?? ''; |
|
| 34 | 34 | $accessToken = $setting['config']['access_token'] ?? ''; |
| 35 | - $channel = $setting['config']['channel'] ?? ''; |
|
| 35 | + $channel = $setting['config']['channel'] ?? ''; |
|
| 36 | 36 | |
| 37 | 37 | return new RocketChat($accessToken, $userId, $serverUrl, $channel); |
| 38 | 38 | } |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | // Create a PDO instance. |
| 38 | 38 | $pdoInstance = new PDO( |
| 39 | 39 | 'mysql:host=' |
| 40 | - . $setting['host'] . ';dbname=' |
|
| 40 | + . $setting['host'] . ';dbname=' |
|
| 41 | 41 | . $setting['dbname'] . ';charset=' |
| 42 | 42 | . $setting['charset'] |
| 43 | 43 | , (string) $setting['user'] |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | // @codeCoverageIgnoreStart |
| 51 | 51 | |
| 52 | - } catch(PDOException $e) { |
|
| 52 | + } catch (PDOException $e) { |
|
| 53 | 53 | echo $e->getMessage(); |
| 54 | 54 | } |
| 55 | 55 | |