@@ -116,7 +116,7 @@ |
||
116 | 116 | // Get the correct logger instance. |
117 | 117 | $logger = null; |
118 | 118 | self::initialize(); |
119 | - if (in_array($name, ['emergency', 'alert', 'critical', 'error', 'warning', 'notice', 'info', 'debug',], true)) { |
|
119 | + if (in_array($name, ['emergency', 'alert', 'critical', 'error', 'warning', 'notice', 'info', 'debug', ], true)) { |
|
120 | 120 | $logger = self::$logger; |
121 | 121 | } elseif ($name === 'update') { |
122 | 122 | $logger = self::$update_logger; |
@@ -154,10 +154,15 @@ discard block |
||
154 | 154 | throw new \RuntimeException(sprintf('The method %s does not exist', $method)); |
155 | 155 | } |
156 | 156 | |
157 | - if (is_array($config)) $this->updateConfiguration($config); |
|
157 | + if (is_array($config)) { |
|
158 | + $this->updateConfiguration($config); |
|
159 | + } |
|
158 | 160 | |
159 | - if (!empty($update)) $this->update = $update; |
|
160 | - else $this->update = Telegram::getUpdate() !== false ? Telegram::getUpdate() : null; |
|
161 | + if (!empty($update)) { |
|
162 | + $this->update = $update; |
|
163 | + } else { |
|
164 | + $this->update = Telegram::getUpdate() !== false ? Telegram::getUpdate() : null; |
|
165 | + } |
|
161 | 166 | |
162 | 167 | if (empty($this->update)) { |
163 | 168 | TelegramLog::error('The update is empty'); |
@@ -201,7 +206,9 @@ discard block |
||
201 | 206 | foreach ($plugins as $plugin) { |
202 | 207 | /** @var Plugin $plugin */ |
203 | 208 | (new $plugin())->__execute($this, $update); |
204 | - if ($this->isActive === false) break; |
|
209 | + if ($this->isActive === false) { |
|
210 | + break; |
|
211 | + } |
|
205 | 212 | } |
206 | 213 | |
207 | 214 | $this->isActive = false; |
@@ -37,8 +37,11 @@ discard block |
||
37 | 37 | */ |
38 | 38 | public static function load(string $path = null): self |
39 | 39 | { |
40 | - if (empty($path)) $data = self::read(getcwd() . '/.env'); |
|
41 | - else $data = self::read($path); |
|
40 | + if (empty($path)) { |
|
41 | + $data = self::read(getcwd() . '/.env'); |
|
42 | + } else { |
|
43 | + $data = self::read($path); |
|
44 | + } |
|
42 | 45 | foreach ($data as $item) { |
43 | 46 | [$key, $value] = $item; |
44 | 47 | if (count($item) == 2) { |
@@ -73,7 +76,9 @@ discard block |
||
73 | 76 | public static function put(string $key, string $value, bool $save = false): void |
74 | 77 | { |
75 | 78 | putenv($key . '=' . $value); |
76 | - if ($save) self::saveTo($_SERVER['DOCUMENT_ROOT'] . '/.env', [$key => $value]); |
|
79 | + if ($save) { |
|
80 | + self::saveTo($_SERVER['DOCUMENT_ROOT'] . '/.env', [$key => $value]); |
|
81 | + } |
|
77 | 82 | } |
78 | 83 | |
79 | 84 | /** |