1 | <?php |
||
28 | class GuzzleClient implements Client |
||
29 | { |
||
30 | /** |
||
31 | * @param string $endpoint |
||
32 | * @return string |
||
33 | */ |
||
34 | private static function applyEndpointVersion($endpoint) |
||
49 | |||
50 | /** |
||
51 | * Creates a new instance of GuzzleAdapter |
||
52 | * |
||
53 | * @param string $endpoint |
||
54 | * @param EventSubscriberInterface[] $plugins |
||
55 | * @return static |
||
56 | */ |
||
57 | public static function create($endpoint, array $plugins = array()) { |
||
75 | |||
76 | /** |
||
77 | * @var ClientInterface |
||
78 | */ |
||
79 | private $guzzle; |
||
80 | |||
81 | /** |
||
82 | * @param ClientInterface $guzzle |
||
83 | */ |
||
84 | public function __construct(ClientInterface $guzzle) |
||
88 | |||
89 | /** |
||
90 | * {@inheritdoc} |
||
91 | * |
||
92 | * @return ClientInterface |
||
93 | */ |
||
94 | public function getGuzzle() |
||
98 | |||
99 | /** |
||
100 | * Returns the client base URL |
||
101 | * |
||
102 | * @return string |
||
103 | */ |
||
104 | public function getBaseUrl() |
||
108 | |||
109 | /** |
||
110 | * Sets the user agent |
||
111 | * |
||
112 | * @param string $userAgent |
||
113 | */ |
||
114 | public function setUserAgent($userAgent) |
||
118 | |||
119 | /** |
||
120 | * Performs an HTTP request, returns the body response |
||
121 | * |
||
122 | * @param string $method The method |
||
123 | * @param string $path The path to query |
||
124 | * @param array $query An array of query parameters |
||
125 | * @param array $postFields An array of post fields |
||
126 | * @param array $files An array of post files |
||
127 | * @param array $headers An array of request headers |
||
128 | * |
||
129 | * @return string The response body |
||
130 | * |
||
131 | * @throws BadResponseException |
||
132 | * @throws RuntimeException |
||
133 | */ |
||
134 | public function call( |
||
156 | |||
157 | private function addRequestParameters(RequestInterface $request, $query, $postFields, $files) |
||
181 | } |
||
182 |