1 | <?php |
||
26 | final class HttpClientConfigurator |
||
27 | { |
||
28 | /** |
||
29 | * @var string |
||
30 | */ |
||
31 | private $endpoint = 'https://api.mailgun.net'; |
||
32 | |||
33 | /** |
||
34 | * If debug is true we will send all the request to the endpoint without appending any path. |
||
35 | * |
||
36 | * @var bool |
||
37 | */ |
||
38 | private $debug = false; |
||
39 | |||
40 | /** |
||
41 | * @var string |
||
42 | */ |
||
43 | private $apiKey; |
||
44 | |||
45 | /** |
||
46 | * @var UriFactory |
||
47 | */ |
||
48 | private $uriFactory; |
||
49 | |||
50 | /** |
||
51 | * @var HttpClient |
||
52 | */ |
||
53 | private $httpClient; |
||
54 | |||
55 | /** |
||
56 | * @var History |
||
57 | */ |
||
58 | private $responseHistory; |
||
59 | |||
60 | public function __construct() |
||
64 | |||
65 | public function createConfiguredClient(): PluginClient |
||
82 | |||
83 | public function setDebug(bool $debug): self |
||
89 | |||
90 | public function setEndpoint(string $endpoint): self |
||
96 | |||
97 | public function getApiKey(): string |
||
101 | |||
102 | public function setApiKey(string $apiKey): self |
||
108 | |||
109 | private function getUriFactory(): UriFactory |
||
117 | |||
118 | public function setUriFactory(UriFactory $uriFactory): self |
||
124 | |||
125 | private function getHttpClient(): HttpClient |
||
133 | |||
134 | public function setHttpClient(HttpClient $httpClient): self |
||
140 | |||
141 | public function getResponseHistory(): History |
||
145 | } |
||
146 |