Skip to content

Commit 9037dba

Browse files
committed
Update example to new eventloop API
1 parent c4ca735 commit 9037dba

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,16 @@ Once [installed](#install), you can use the following code to decorate a demo
1515
function and avoid sending unneeded HTTP requests:
1616

1717
```php
18-
$browser = new React\Http\Browser($loop);
18+
<?php
19+
20+
require __DIR__ . '/vendor/autoload.php';
21+
22+
$browser = new React\Http\Browser();
1923

2024
$fetch = function (int $id) use ($browser) {
21-
return $browser->get('http://httpbingo.org/status/' . $id)->then(function (ResponseInterface $response) {
25+
return $browser->get(
26+
'http://httpbingo.org/status/' . $id
27+
)->then(function (Psr\Http\Message\ResponseInterface $response) {
2228
return $response->getStatusCode();
2329
});
2430
}

0 commit comments

Comments
 (0)