Conditions | 1 |
Paths | 1 |
Total Lines | 15 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
11 | 1 | public static function default( |
|
12 | int $maxFailures = 30, |
||
13 | int $baseWaitTime = 20, |
||
14 | int $maxWaitTime = 30000 |
||
15 | ): CircuitBreaker { |
||
16 | 1 | $storage = new APCuStorage(); |
|
17 | 1 | $strategy = new TimeBackoff( |
|
18 | 1 | $storage, |
|
19 | 1 | new Exponential(), |
|
20 | 1 | $maxFailures, |
|
21 | 1 | $baseWaitTime, |
|
22 | 1 | $maxWaitTime |
|
23 | ); |
||
24 | |||
25 | 1 | return new CircuitBreaker($strategy, $storage); |
|
26 | } |
||
28 |