1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
util.php
См. документацию.
1<?php
2
3namespace Bitrix\MessageService\Sender;
4
5use Bitrix\Main\Config\Option;
6use Bitrix\Main\Error;
7use Bitrix\Main\Loader;
8use Bitrix\Main\Web\HttpClient;
9
10class Util
11{
12 public static function getHttpClientError(HttpClient $httpClient): ?Error
13 {
14 $err = $httpClient->getError();
15 if (empty($err))
16 {
17 return null;
18 }
19 $code = array_key_first($err);
20
21 return new Error($err[$code], $code);
22 }
23
24 public static function getHttpClientErrorString(HttpClient $httpClient): ?string
25 {
26 $err = $httpClient->getError();
27 if (empty($err))
28 {
29 return null;
30 }
31 $code = array_key_first($err);
32
33 return "[{$code}]: {$err[$code]}";
34 }
35}
Определения error.php:15
static getHttpClientErrorString(HttpClient $httpClient)
Определения util.php:24
static getHttpClientError(HttpClient $httpClient)
Определения util.php:12
if(!is_null($config))($config as $configItem)(! $configItem->isVisible()) $code
Определения options.php:195