Lines Matching refs:changes
162 * @param array $changes Changes to apply.
166 public static function modifyRequest(RequestInterface $request, array $changes) argument
168 if (!$changes) {
174 if (!isset($changes['uri'])) {
178 if ($host = $changes['uri']->getHost()) {
179 $changes['set_headers']['Host'] = $host;
181 if ($port = $changes['uri']->getPort()) {
183 $scheme = $changes['uri']->getScheme();
185 $changes['set_headers']['Host'] .= ':' . $port;
189 $uri = $changes['uri'];
192 if (!empty($changes['remove_headers'])) {
193 $headers = self::caselessRemove($changes['remove_headers'], $headers);
196 if (!empty($changes['set_headers'])) {
197 $headers = self::caselessRemove(array_keys($changes['set_headers']), $headers);
198 $headers = $changes['set_headers'] + $headers;
201 if (isset($changes['query'])) {
202 $uri = $uri->withQuery($changes['query']);
207 isset($changes['method']) ? $changes['method'] : $request->getMethod(),
210 isset($changes['body']) ? $changes['body'] : $request->getBody(),
211 isset($changes['version'])
212 ? $changes['version']
229 isset($changes['method']) ? $changes['method'] : $request->getMethod(),
232 isset($changes['body']) ? $changes['body'] : $request->getBody(),
233 isset($changes['version'])
234 ? $changes['version']