@@ -367,7 +367,7 @@ class YourApi extends Api
367
367
368
368
#### ` addPreRequestListener `
369
369
370
- The ` addPreRequestListener ` method is used to add a function that is called before a request, and all handled data, has been made.
370
+ The ` addPreRequestListener ` method is used to add a function that is called before a request has been made.
371
371
This event listener will be applied to every API request.
372
372
373
373
``` php
@@ -673,8 +673,7 @@ The following list has all the implemented plugins with the respective priority
673
673
| [ ` LoggerPlugin ` ] ( https://docs.php-http.org/en/latest/plugins/logger.html ) | 8 | only if logger is enabled |
674
674
675
675
For example, if you wanted the client to automatically attempt to re-send a request that failed
676
- (due to unreliable connections and servers, for example)
677
- you can add the [ RetryPlugin] ( https://docs.php-http.org/en/latest/plugins/retry.html ) ;
676
+ (due to unreliable connections and servers, for example) you can add the [ RetryPlugin] ( https://docs.php-http.org/en/latest/plugins/retry.html ) :
678
677
679
678
``` php
680
679
use ProgrammatorDev\Api\Api;
@@ -687,11 +686,11 @@ class YourApi extends Api
687
686
// ...
688
687
689
688
// if a request fails, it will retry at least 3 times
690
- // priority is 12 to execute the plugin between the cache and logger plugins
689
+ // priority is 20 to execute before the cache plugin
691
690
// (check the above plugin order list for more information)
692
691
$this->getClientBuilder()->addPlugin(
693
- plugin: new RetryPlugin(['retries' => 3])
694
- priority: 12
692
+ plugin: new RetryPlugin(['retries' => 3]),
693
+ priority: 20
695
694
);
696
695
}
697
696
}
@@ -895,7 +894,7 @@ class YourApi extends Api
895
894
}
896
895
```
897
896
898
- For the end user , it should look like this:
897
+ When using the API , it should look like this:
899
898
900
899
``` php
901
900
$api = new YourApi([
0 commit comments