Skip to content

Commit

Permalink
Documentation updates and minor rewrites (#357)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nyholm authored Dec 27, 2018
1 parent 1a39a2f commit fdb77e7
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 13 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ composer require kriswallsmith/buzz
This page will just show you the basics, please [read the full documentation](doc/index.md).

```php
$client = new Buzz\Client\FileGetContents([], new Psr17ResponseFactory());
$client = new Buzz\Client\FileGetContents(new Psr17ResponseFactory());
$browser = new Buzz\Browser($client, new Psr17RequestFactory());
$response = $browser->get('http://www.google.com');

Expand All @@ -42,7 +42,7 @@ You can also use the low-level HTTP classes directly.
```php
$request = new PSR7Request('GET', 'https://google.com/foo');

$client = new Buzz\Client\FileGetContents([], new Psr17ResponseFactory());
$client = new Buzz\Client\FileGetContents(new Psr17ResponseFactory());
$response = $client->send($request, ['timeout' => 4]);

echo $response->getStatusCode();
Expand Down
7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"php": "^7.1",
"psr/http-message": "^1.0",
"psr/http-client": "^1.0",
"php-http/httplug": "^1.1 || ^2.0",
"php-http/httplug": "^2.0",
"symfony/options-resolver": "^3.4 || ^4.0",
"psr/http-factory": "^1.0"
},
Expand All @@ -33,10 +33,11 @@
"symfony/phpunit-bridge": "^4.0"
},
"provide": {
"php-http/client-implementation": "1.0"
"php-http/client-implementation": "1.0",
"psr/http-client-implementation": "1.0"
},
"suggest": {
"ext-curl": "*"
"ext-curl": "To use our cUrl clients"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion doc/client.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ There are 3 clients: `FileGetContents`, `Curl` and `MultiCurl`.
```php
$request = new PSR7Request('GET', 'https://example.com');

$client = new Buzz\Client\FileGetContents(['allow_redirects' => true], new Psr17ResponseFactory());
$client = new Buzz\Client\FileGetContents(new Psr17ResponseFactory(), ['allow_redirects' => true]);
$response = $client->send($request, ['timeout' => 4]);
```

Expand Down
2 changes: 1 addition & 1 deletion doc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ When a `Browser` in constructed you have to select a [Client](/doc/client.md) to
to use the Bowser:

```php
$client = new Buzz\Client\FileGetContents([], new Psr17ResponseFactory());
$client = new Buzz\Client\FileGetContents(new Psr17ResponseFactory());
$browser = new Buzz\Browser($client, new Psr17RequestFactory());

$response = $browser->get('https://example.com');
Expand Down
1 change: 0 additions & 1 deletion doc/middlewares.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ class UserAgentMiddleware implements MiddlewareInterface
}
```


---

Continue reading about [Symfony integration](/doc/symfony.md).
1 change: 0 additions & 1 deletion doc/symfony.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ You will now have a service named `httplug.client.my_buzz`. You can of course ad
plugins method clients and whatever you want according to the
[HTTPlug documentation](http://docs.php-http.org/en/latest/integrations/symfony-bundle.html).


---

Go back to [index](/doc/index.md).
8 changes: 4 additions & 4 deletions lib/Client/BatchClientInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ interface BatchClientInterface extends \Countable
public function sendAsyncRequest(RequestInterface $request, array $options = []): void;

/**
* Processes all queued requests.
* Processes all queued requests. This is blocking.
*
* @throws ClientException If something goes wrong
* @throws ClientException If something goes wrong with initializing cUrl
*/
public function flush(): void;

/**
* Processes zero or more queued requests.
* Processes zero or more queued requests. This is non-blocking.
*
* @throws ClientException If something goes wrong
* @throws ClientException If something goes wrong with initializing cUrl
*/
public function proceed(): void;
}

0 comments on commit fdb77e7

Please sign in to comment.