1 | <?php |
||
19 | class ClientBuilder |
||
20 | { |
||
21 | /** |
||
22 | * @var \Http\Client\HttpClient |
||
23 | */ |
||
24 | private $httpClient; |
||
25 | |||
26 | /** |
||
27 | * @var \Http\Message\UriFactory |
||
28 | */ |
||
29 | private $uriFactory; |
||
30 | |||
31 | /** |
||
32 | * @var array |
||
33 | */ |
||
34 | private $prependPlugins = []; |
||
35 | |||
36 | /** |
||
37 | * @var array |
||
38 | */ |
||
39 | private $appendPlugins = []; |
||
40 | |||
41 | /** |
||
42 | * ClientBuilder constructor. |
||
43 | * |
||
44 | * @param \Http\Client\HttpClient|null $httpClient |
||
45 | * @param \Http\Message\UriFactory|null $uriFactory |
||
46 | */ |
||
47 | 9 | public function __construct(HttpClient $httpClient = null, UriFactory $uriFactory = null) |
|
52 | |||
53 | /** |
||
54 | * @return \Http\Client\HttpClient |
||
55 | */ |
||
56 | 6 | public function createConfiguredClient(): HttpClient |
|
62 | |||
63 | /** |
||
64 | * @param \Http\Client\Common\Plugin[] ...$plugin |
||
65 | * |
||
66 | * @return \AdamPaterson\ApiClient\Foundation\Http\ClientBuilder |
||
67 | */ |
||
68 | 3 | public function appendPlugin(Plugin ...$plugin): ClientBuilder |
|
76 | |||
77 | /** |
||
78 | * @param \Http\Client\Common\Plugin[] ...$plugin |
||
79 | * |
||
80 | * @return \AdamPaterson\ApiClient\Foundation\Http\ClientBuilder |
||
81 | */ |
||
82 | 3 | public function prependPlugin(Plugin ...$plugin): ClientBuilder |
|
91 | } |
||
92 |