Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
util.php
1
<?php
2
3
namespace
Bitrix\MessageService\Sender
;
4
5
use
Bitrix\Main\Config\Option
;
6
use
Bitrix\Main\Error
;
7
use
Bitrix\Main\Loader
;
8
use
Bitrix\Main\Web\HttpClient
;
9
10
class
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
}
Bitrix\Main\Config\Option
Definition
option.php:15
Bitrix\Main\Error
Definition
error.php:14
Bitrix\Main\Loader
Definition
loader.php:12
Bitrix\Main\Web\HttpClient
Definition
httpclient.php:24
Bitrix\Main\Web\HttpClient\getError
getError()
Definition
httpclient.php:753
Bitrix\MessageService\Sender\Util
Definition
util.php:11
Bitrix\MessageService\Sender\Util\getHttpClientErrorString
static getHttpClientErrorString(HttpClient $httpClient)
Definition
util.php:24
Bitrix\MessageService\Sender\Util\getHttpClientError
static getHttpClientError(HttpClient $httpClient)
Definition
util.php:12
Bitrix\MessageService\Sender
Definition
base.php:2
modules
messageservice
lib
sender
util.php
Создано системой
1.10.0