@@ -31,15 +31,15 @@ discard block |
||
31 | 31 | |
32 | 32 | $breaker1FailureCount = 0; |
33 | 33 | |
34 | - $breaker->addListener(CircuitEvents::FAILURE, function (CircuitEvent $event) use (&$breaker1FailureCount) { |
|
34 | + $breaker->addListener(CircuitEvents::FAILURE, function(CircuitEvent $event) use (&$breaker1FailureCount) { |
|
35 | 35 | $breaker1FailureCount = $event->getCircuit()->getFailures(); |
36 | 36 | }); |
37 | 37 | |
38 | - $breaker2->addListener(CircuitEvents::FAILURE, function (CircuitEvent $event) use (&$breaker1FailureCount) { |
|
38 | + $breaker2->addListener(CircuitEvents::FAILURE, function(CircuitEvent $event) use (&$breaker1FailureCount) { |
|
39 | 39 | $this->assertEquals($breaker1FailureCount, $event->getCircuit()->getFailures()); |
40 | 40 | }); |
41 | 41 | |
42 | - $fn = function () { |
|
42 | + $fn = function() { |
|
43 | 43 | throw new CustomException("An error as occurred"); |
44 | 44 | }; |
45 | 45 | |
@@ -58,13 +58,13 @@ discard block |
||
58 | 58 | ['exclude_exceptions' => ['Eljam\CircuitBreaker\Exception\CustomException']] |
59 | 59 | ); |
60 | 60 | |
61 | - $breaker->addListener(CircuitEvents::OPEN, function (CircuitEvent $event) { |
|
61 | + $breaker->addListener(CircuitEvents::OPEN, function(CircuitEvent $event) { |
|
62 | 62 | $this->assertInstanceOf('Eljam\CircuitBreaker\Circuit', $event->getCircuit()); |
63 | 63 | }); |
64 | 64 | |
65 | 65 | $this->setExpectedException('Eljam\CircuitBreaker\Exception\CircuitOpenException'); |
66 | 66 | |
67 | - $fn = function () { |
|
67 | + $fn = function() { |
|
68 | 68 | throw new CustomException("An error as occurred"); |
69 | 69 | }; |
70 | 70 | |
@@ -86,11 +86,11 @@ discard block |
||
86 | 86 | ] |
87 | 87 | ); |
88 | 88 | |
89 | - $breaker->addListener(CircuitEvents::HALF_OPEN, function (CircuitEvent $event) { |
|
89 | + $breaker->addListener(CircuitEvents::HALF_OPEN, function(CircuitEvent $event) { |
|
90 | 90 | $this->assertInstanceOf('Eljam\CircuitBreaker\Circuit', $event->getCircuit()); |
91 | 91 | }); |
92 | 92 | |
93 | - $fn = function () { |
|
93 | + $fn = function() { |
|
94 | 94 | throw new CustomException("An error as occurred"); |
95 | 95 | }; |
96 | 96 | |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | |
105 | 105 | sleep(2); |
106 | 106 | |
107 | - $fnPass = function () { |
|
107 | + $fnPass = function() { |
|
108 | 108 | return 'ok'; |
109 | 109 | }; |
110 | 110 | |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | $breaker = new Breaker('simple_echo'); |
120 | 120 | $hello = 'eljam'; |
121 | 121 | |
122 | - $fn = function () use ($hello) { |
|
122 | + $fn = function() use ($hello) { |
|
123 | 123 | return $hello; |
124 | 124 | }; |
125 | 125 | |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | ); |
140 | 140 | $hello = 'eljam'; |
141 | 141 | |
142 | - $fn = function () use ($hello) { |
|
142 | + $fn = function() use ($hello) { |
|
143 | 143 | throw new CustomException("An error as occurred"); |
144 | 144 | |
145 | 145 | return $hello; |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | |
163 | 163 | $this->setExpectedException('Eljam\CircuitBreaker\Exception\CustomException'); |
164 | 164 | |
165 | - $fn = function () use ($hello) { |
|
165 | + $fn = function() use ($hello) { |
|
166 | 166 | throw new CustomException("An error as occurred"); |
167 | 167 | |
168 | 168 | return $hello; |
@@ -184,11 +184,11 @@ discard block |
||
184 | 184 | ); |
185 | 185 | |
186 | 186 | $breaker1FailureCount = 0; |
187 | - $breaker->addListener(CircuitEvents::FAILURE, function (CircuitEvent $event) use (&$breaker1FailureCount) { |
|
187 | + $breaker->addListener(CircuitEvents::FAILURE, function(CircuitEvent $event) use (&$breaker1FailureCount) { |
|
188 | 188 | $breaker1FailureCount = $event->getCircuit()->getFailures(); |
189 | 189 | }); |
190 | 190 | |
191 | - $fn = function () { |
|
191 | + $fn = function() { |
|
192 | 192 | throw new CustomException("An error as occurred"); |
193 | 193 | }; |
194 | 194 |