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/cvetdv.ru/bitrix/modules/yandex.market/lib/api/reference/ |
Upload File : |
<?php namespace Yandex\Market\Api\Reference; use Yandex\Market\Psr\Log\LoggerInterface; use Yandex\Market\Reference\Assert; abstract class RequestTokenized extends Request { /** @var Auth */ protected $auth; public function __construct($auth = null, LoggerInterface $logger = null) { parent::__construct($logger); $this->auth = $this->authFactory($auth); } private function authFactory($auth) { if ($auth === null) // wait delayed setOauthToken { return new ApiKey(''); } if ($auth instanceof HasAuth) { return $auth->getApiAuth(); } if ($auth instanceof HasOauthConfiguration) { return new OAuth($auth->getOauthToken()->getAccessToken()); } Assert::isInstanceOf($auth, Auth::class); return $auth; } /** * @deprecated * @noinspection PhpUnused */ public function setOauthToken($oauthToken) { $this->auth = new OAuth($oauthToken); } /** * @deprecated * @noinspection PhpUnused */ public function getOauthToken() {} protected function buildClient() { $result = parent::buildClient(); $result->setHeader(...$this->auth->getHeader()); return $result; } }