Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/location/lib/source/osm/ |
Upload File : |
<?php namespace Bitrix\Location\Source\Osm; /** * Class Token * @package Bitrix\Location\Source\Osm * @inernal */ final class Token { /** @var string */ private $token; /** @var int */ private $expiry; /** * Token constructor. * @param string $token * @param int $expiry */ public function __construct(string $token, int $expiry) { $this->token = $token; $this->expiry = $expiry; } /** * @return string */ public function getToken(): string { return $this->token; } /** * @return int */ public function getExpiry(): int { return $this->expiry; } /** * @return array */ public function convertToArray(): array { return [ 'token' => $this->token, 'expire' => $this->expiry, ]; } /** * @param array $token * @return Token|null */ public static function makeFromArray(array $token): ?Token { if(empty($token['token']) || empty($token['expire'])) { return null; } return new Token( $token['token'], $token['expire'] ); } }