Total Complexity | 6 |
Total Lines | 62 |
Duplicated Lines | 0 % |
Coverage | 86.67% |
Changes | 0 |
1 | <?php |
||
15 | trait RetryTrait |
||
16 | { |
||
17 | /** |
||
18 | * Retry Times |
||
19 | * |
||
20 | * @var int |
||
21 | */ |
||
22 | private $retry = 0; |
||
23 | |||
24 | /** |
||
25 | * Retry Strings |
||
26 | * |
||
27 | * @var string[] |
||
28 | */ |
||
29 | private $retryStrings = []; |
||
30 | |||
31 | /** |
||
32 | * Retry Codes |
||
33 | * |
||
34 | * @var int[] |
||
35 | */ |
||
36 | private $retryStatusCodes = []; |
||
37 | |||
38 | /** |
||
39 | * @param int $times |
||
40 | * @param array $strings |
||
41 | * @param array $statusCodes |
||
42 | * |
||
43 | * @return $this |
||
44 | * @throws ClientException |
||
45 | */ |
||
46 | 2 | public function retry($times, array $strings, array $statusCodes = []) |
|
53 | } |
||
54 | |||
55 | /** |
||
56 | * @param Result $result |
||
57 | * |
||
58 | * @return bool |
||
59 | */ |
||
60 | 21 | private function shouldRetry(Result $result) |
|
79 |
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.