You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Plugin/RetryPlugin.php
+30-13
Original file line number
Diff line number
Diff line change
@@ -31,12 +31,12 @@ final class RetryPlugin implements Plugin
31
31
/**
32
32
* @var callable
33
33
*/
34
-
private$delay;
34
+
private$exceptionDelay;
35
35
36
36
/**
37
37
* @var callable
38
38
*/
39
-
private$decider;
39
+
private$exceptionDecider;
40
40
41
41
/**
42
42
* Store the retry counter for each request.
@@ -48,30 +48,47 @@ final class RetryPlugin implements Plugin
48
48
/**
49
49
* @param array $config {
50
50
*
51
-
* @var int $retries Number of retries to attempt if an exception occurs before letting the exception bubble up
52
-
* @var callable $decider A callback that gets a request and an exception to decide after a failure whether the request should be retried
53
-
* @var callable $delay A callback that gets a request, an exception and the number of retries and returns how many microseconds we should wait before trying again.
51
+
* @var int $retries Number of retries to attempt if an exception occurs before letting the exception bubble up.
52
+
* @var callable $exception_decider A callback that gets a request and an exception to decide after a failure whether the request should be retried.
53
+
* @var callable $exception_delay A callback that gets a request, an exception and the number of retries and returns how many microseconds we should wait before trying again.
54
54
* }
55
55
*/
56
56
publicfunction__construct(array$config = [])
57
57
{
58
+
if (array_key_exists('decider', $config)) {
59
+
if (array_key_exists('exception_decider', $config)) {
60
+
thrownew \InvalidArgumentException('Do not set both the old "decider" and new "exception_decider" options');
61
+
}
62
+
trigger_error('The "decider" option has been deprecated in favour of "exception_decider"', E_USER_DEPRECATED);
0 commit comments