@@ -23,7 +23,7 @@ |
||
| 23 | 23 | return $this; |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | - public function closure(Closure $closure) :?array |
|
| 26 | + public function closure(Closure $closure) : ?array |
|
| 27 | 27 | { |
| 28 | 28 | try { |
| 29 | 29 | return $closure(); |
@@ -16,9 +16,11 @@ |
||
| 16 | 16 | return $this; |
| 17 | 17 | } |
| 18 | 18 | |
| 19 | - public function do(Closure $closure) :Breaker |
|
| 19 | + public function do { |
|
| 20 | + (Closure $closure) :Breaker |
|
| 20 | 21 | { |
| 21 | 22 | $this->closure = $closure; |
| 23 | + } |
|
| 22 | 24 | |
| 23 | 25 | return $this; |
| 24 | 26 | } |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | ->addBreaker($firstBreaker) |
| 23 | 23 | ->addBreaker($secondBreaker) |
| 24 | 24 | ->addBreaker($thirdBreaker) |
| 25 | - ->closure(function(){ |
|
| 25 | + ->closure(function() { |
|
| 26 | 26 | throw new Exception(); |
| 27 | 27 | }); |
| 28 | 28 | |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | |
| 43 | 43 | $results = (new CircuitBreaker()) |
| 44 | 44 | ->addBreaker($firstBreaker) |
| 45 | - ->closure(function(){ |
|
| 45 | + ->closure(function() { |
|
| 46 | 46 | return; |
| 47 | 47 | }); |
| 48 | 48 | |