Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
token.php
1
<?php
2
3
namespace
Bitrix\Location\Source\Osm
;
4
10
final
class
Token
11
{
13
private
$token;
14
16
private
$expiry;
17
23
public
function
__construct
(
string
$token,
int
$expiry)
24
{
25
$this->token = $token;
26
$this->expiry = $expiry;
27
}
28
32
public
function
getToken
(): string
33
{
34
return
$this->token;
35
}
36
40
public
function
getExpiry
(): int
41
{
42
return
$this->expiry;
43
}
44
48
public
function
convertToArray
(): array
49
{
50
return
[
51
'token'
=> $this->token,
52
'expire'
=> $this->expiry,
53
];
54
}
55
60
public
static
function
makeFromArray
(array $token): ?
Token
61
{
62
if
(empty($token[
'token'
]) || empty($token[
'expire'
]))
63
{
64
return
null
;
65
}
66
67
return
new
Token
(
68
$token[
'token'
],
69
$token[
'expire'
]
70
);
71
}
72
}
Bitrix\Location\Source\Osm\Token
Definition
token.php:11
Bitrix\Location\Source\Osm\Token\getExpiry
getExpiry()
Definition
token.php:40
Bitrix\Location\Source\Osm\Token\convertToArray
convertToArray()
Definition
token.php:48
Bitrix\Location\Source\Osm\Token\getToken
getToken()
Definition
token.php:32
Bitrix\Location\Source\Osm\Token\makeFromArray
static makeFromArray(array $token)
Definition
token.php:60
Bitrix\Location\Source\Osm\Token\__construct
__construct(string $token, int $expiry)
Definition
token.php:23
Bitrix\Location\Source\Osm
modules
location
lib
source
osm
token.php
Создано системой
1.10.0