Request.php
904 字节
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
namespace Lackoxygen\TiktokShop\Request;
use Lackoxygen\TiktokShop\Attribute\Config\Config;
use Lackoxygen\TiktokShop\Attribute\Config\Option;
use Lackoxygen\TiktokShop\Exception\ClientException;
use Lackoxygen\TiktokShop\Support\Client\Builder;
use Psr\Http\Message\ResponseInterface;
abstract class Request extends Config
{
/**
* @var Builder
*/
protected Builder $builder;
/**
* @param Option $config
* @param string $method
*/
public function __construct(Option $config, string $method)
{
parent::__construct($config);
$this->builder = Builder::create(
$config,
get_class($this),
$method
);
}
/**
* @return ResponseInterface
* @throws ClientException
*/
public function __invoke(): ResponseInterface
{
return $this->builder->request();
}
}