Skip to content

Commit e9200f7

Browse files
committed
Update readme
1 parent 577edd2 commit e9200f7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -343,8 +343,8 @@ use Psr\Http\Message\RequestInterface;
343343
use Psr\Http\Message\ResponseInterface;
344344

345345
LazyJsonPages::from($source)
346-
->onRequest(fn (RequestInterface $request) => ...)
347-
->onResponse(fn (ResponseInterface $response, RequestInterface $request) => ...);
346+
->onRequest(fn(RequestInterface $request) => ...)
347+
->onResponse(fn(ResponseInterface $response, RequestInterface $request) => ...);
348348
```
349349

350350
We can also tweak the number of allowed seconds before an API connection times out or the allowed duration of the entire HTTP request (by default they are both set to 5 seconds):
@@ -361,7 +361,7 @@ If the 3rd party API is faulty or error-prone, we can indicate how many times we
361361
// repeat failing requests 5 times after a backoff of 1, 2, 3, 4 and 5 seconds
362362
LazyJsonPages::from($source)
363363
->attempts(5)
364-
->backoff(fn (int $attempt) => $attempt * 1000);
364+
->backoff(fn(int $attempt) => $attempt * 1000);
365365
```
366366

367367
### 💢 Errors handling
@@ -373,7 +373,7 @@ use Psr\Http\Message\RequestInterface;
373373
use Psr\Http\Message\ResponseInterface;
374374

375375
LazyJsonPages::from($source)
376-
->onError(fn (Throwable $e, RequestInterface $request, ?ResponseInterface $response) => ...);
376+
->onError(fn(Throwable $e, RequestInterface $request, ?ResponseInterface $response) => ...);
377377
```
378378

379379
Any exception thrown by this package extends the `LazyJsonPagesException` class. This makes it easy to handle all exceptions in a single catch block:

0 commit comments

Comments
 (0)