@@ -36,30 +36,30 @@ discard block |
||
| 36 | 36 | { |
| 37 | 37 | try { |
| 38 | 38 | $log = new Log(); |
| 39 | - if(is_callable($this->context)) { |
|
| 39 | + if (is_callable($this->context)) { |
|
| 40 | 40 | try { |
| 41 | 41 | $this->context = call_user_func($this->context, $exception); |
| 42 | - } catch(\Exception $e) { |
|
| 42 | + } catch (\Exception $e) { |
|
| 43 | 43 | self::logInnerException(new \Exception('Can not call ' . (string) $this->context)); |
| 44 | 44 | } |
| 45 | 45 | } |
| 46 | - if(!is_array($this->context)) { |
|
| 46 | + if (!is_array($this->context)) { |
|
| 47 | 47 | $this->context = (!empty($this->context) ? [$this->context] : []); |
| 48 | 48 | } |
| 49 | - if($logType == \Bitrix\Main\Diag\ExceptionHandlerLog::LOW_PRIORITY_ERROR) { |
|
| 49 | + if ($logType == \Bitrix\Main\Diag\ExceptionHandlerLog::LOW_PRIORITY_ERROR) { |
|
| 50 | 50 | $log->error($exception, $this->context); |
| 51 | 51 | } else { |
| 52 | 52 | $telegramBlocked = false; |
| 53 | - if($_ENV['APP_LOG_NO_TELEGRAM']) { |
|
| 53 | + if ($_ENV['APP_LOG_NO_TELEGRAM']) { |
|
| 54 | 54 | $blockStrings = explode('|', $_ENV['APP_LOG_NO_TELEGRAM']); |
| 55 | - foreach($blockStrings as $blockString) { |
|
| 56 | - if(stripos($exception, $blockString) !== false) { |
|
| 55 | + foreach ($blockStrings as $blockString) { |
|
| 56 | + if (stripos($exception, $blockString) !== false) { |
|
| 57 | 57 | $telegramBlocked = true; |
| 58 | 58 | break; |
| 59 | 59 | } |
| 60 | 60 | } |
| 61 | 61 | } |
| 62 | - if($telegramBlocked) { |
|
| 62 | + if ($telegramBlocked) { |
|
| 63 | 63 | $log->error($exception, $this->context); |
| 64 | 64 | } else { |
| 65 | 65 | $this->context['source'] = self::logTypeToString($logType); |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | } |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | - } catch(\Exception $e) { |
|
| 70 | + } catch (\Exception $e) { |
|
| 71 | 71 | self::logInnerException($e); |
| 72 | 72 | } |
| 73 | 73 | } |