@@ -26,21 +26,21 @@ discard block |
||
26 | 26 | */ |
27 | 27 | public function testMultiProcess() |
28 | 28 | { |
29 | - $fileCache = new FilesystemCache($this->dir, 'txt'); |
|
29 | + $fileCache = new FilesystemCache($this->dir, 'txt'); |
|
30 | 30 | $breaker = new Breaker('github_api', ['ignore_exceptions' => true], $fileCache); |
31 | 31 | $breaker2 = new Breaker('github_api', ['ignore_exceptions' => true], $fileCache); |
32 | 32 | |
33 | 33 | $breaker1FailureCount = 0; |
34 | 34 | |
35 | - $breaker->addListener(CircuitEvents::FAILURE, function (Event $event) use (&$breaker1FailureCount) { |
|
35 | + $breaker->addListener(CircuitEvents::FAILURE, function(Event $event) use (&$breaker1FailureCount) { |
|
36 | 36 | $breaker1FailureCount = $event->getCircuit()->getFailures(); |
37 | 37 | }); |
38 | 38 | |
39 | - $breaker2->addListener(CircuitEvents::FAILURE, function (Event $event) use (&$breaker1FailureCount) { |
|
39 | + $breaker2->addListener(CircuitEvents::FAILURE, function(Event $event) use (&$breaker1FailureCount) { |
|
40 | 40 | $this->assertEquals($breaker1FailureCount, $event->getCircuit()->getFailures()); |
41 | 41 | }); |
42 | 42 | |
43 | - $fn = function () { |
|
43 | + $fn = function() { |
|
44 | 44 | throw new CustomException("An error as occured"); |
45 | 45 | }; |
46 | 46 | |
@@ -60,13 +60,13 @@ discard block |
||
60 | 60 | ['exclude_exceptions' => [CustomException::class]] |
61 | 61 | ); |
62 | 62 | |
63 | - $breaker->addListener(CircuitEvents::OPEN, function (Event $event) { |
|
63 | + $breaker->addListener(CircuitEvents::OPEN, function(Event $event) { |
|
64 | 64 | $this->assertInstanceOf(Circuit::class, $event->getCircuit()); |
65 | 65 | }); |
66 | 66 | |
67 | 67 | $this->setExpectedException('Eljam\CircuitBreaker\Exception\CircuitOpenException'); |
68 | 68 | |
69 | - $fn = function () { |
|
69 | + $fn = function() { |
|
70 | 70 | throw new CustomException("An error as occured"); |
71 | 71 | }; |
72 | 72 | |
@@ -88,11 +88,11 @@ discard block |
||
88 | 88 | ] |
89 | 89 | ); |
90 | 90 | |
91 | - $breaker->addListener(CircuitEvents::HALF_OPEN, function (Event $event) { |
|
91 | + $breaker->addListener(CircuitEvents::HALF_OPEN, function(Event $event) { |
|
92 | 92 | $this->assertInstanceOf(Circuit::class, $event->getCircuit()); |
93 | 93 | }); |
94 | 94 | |
95 | - $fn = function () { |
|
95 | + $fn = function() { |
|
96 | 96 | throw new CustomException("An error as occured"); |
97 | 97 | }; |
98 | 98 | |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | |
107 | 107 | sleep(2); |
108 | 108 | |
109 | - $fnPass = function () { |
|
109 | + $fnPass = function() { |
|
110 | 110 | return 'ok'; |
111 | 111 | }; |
112 | 112 | |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | $breaker = new Breaker('simple_echo'); |
122 | 122 | $hello = 'eljam'; |
123 | 123 | |
124 | - $fn = function () use ($hello) { |
|
124 | + $fn = function() use ($hello) { |
|
125 | 125 | return $hello; |
126 | 126 | }; |
127 | 127 | |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | ); |
142 | 142 | $hello = 'eljam'; |
143 | 143 | |
144 | - $fn = function () use ($hello) { |
|
144 | + $fn = function() use ($hello) { |
|
145 | 145 | throw new CustomException("An error as occured"); |
146 | 146 | |
147 | 147 | return $hello; |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | |
165 | 165 | $this->setExpectedException('Eljam\CircuitBreaker\Exception\CustomException'); |
166 | 166 | |
167 | - $fn = function () use ($hello) { |
|
167 | + $fn = function() use ($hello) { |
|
168 | 168 | throw new CustomException("An error as occured"); |
169 | 169 | |
170 | 170 | return $hello; |
@@ -144,7 +144,7 @@ |
||
144 | 144 | * addListener. |
145 | 145 | * |
146 | 146 | * @param string $eventName |
147 | - * @param \Closure|array $listener |
|
147 | + * @param \Closure $listener |
|
148 | 148 | */ |
149 | 149 | public function addListener($eventName, $listener) |
150 | 150 | { |