1
0
mirror of https://github.com/guzzle/guzzle.git synced 2025-02-24 01:53:58 +01:00

Merge pull request #2113 from tarjei/docs-patch-1

Clean up variable naming to make docs a bit clearer
This commit is contained in:
Márk Sági-Kazár 2018-07-28 22:27:54 +02:00 committed by GitHub
commit 9133fe03c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -37,8 +37,8 @@ a response or exception by shifting return values off of a queue.
new RequestException("Error Communicating with Server", new Request('GET', 'test'))
]);
$handler = HandlerStack::create($mock);
$client = new Client(['handler' => $handler]);
$handlerStack = HandlerStack::create($mock);
$client = new Client(['handler' => $handlerStack]);
// The first request is intercepted with the first response.
echo $client->request('GET', '/')->getStatusCode();
@ -68,11 +68,13 @@ history of the requests that were sent by a client.
$container = [];
$history = Middleware::history($container);
$stack = HandlerStack::create();
$handlerStack = HandlerStack::create();
// or $handlerStack = HandlerStack::create($mock); if using the Mock handler.
// Add the history middleware to the handler stack.
$stack->push($history);
$handlerStack->push($history);
$client = new Client(['handler' => $stack]);
$client = new Client(['handler' => $handlerStack]);
$client->request('GET', 'http://httpbin.org/get');
$client->request('HEAD', 'http://httpbin.org/get');