@@ -33,7 +33,7 @@ |
||
| 33 | 33 | return $promise; |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - return $promise->then(function (ResponseInterface $response) use ($serviceName) { |
|
| 36 | + return $promise->then(function(ResponseInterface $response) use ($serviceName) { |
|
| 37 | 37 | $wasSuccessful = $response->getStatusCode() >= 200 && $response->getStatusCode() < 300; |
| 38 | 38 | if ($wasSuccessful) { |
| 39 | 39 | $this->circuitBreaker->reportSuccess($serviceName); |
@@ -51,7 +51,7 @@ |
||
| 51 | 51 | ); |
| 52 | 52 | |
| 53 | 53 | $storage->numberOfFailures(self::A_SERVICE)->willReturn(self::MAX_FAILURES); |
| 54 | - $oneSecAndOneMillisecond = floor((microtime(true) * 1000)) - 1001; |
|
| 54 | + $oneSecAndOneMillisecond = floor((microtime(true) * 1000))-1001; |
|
| 55 | 55 | $storage->getStrategyData($strategy, "last_try") |
| 56 | 56 | ->willReturn((string) $oneSecAndOneMillisecond); |
| 57 | 57 | $storage->resetFailuresCounter(self::A_SERVICE)->shouldBeCalledTimes(1); |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | $lastRetry = $this->getLastTryTime(); |
| 29 | - if ($this->now() - $lastRetry > $this->waitTime) { |
|
| 29 | + if ($this->now()-$lastRetry > $this->waitTime) { |
|
| 30 | 30 | $this->storage->resetFailuresCounter($serviceName); |
| 31 | 31 | return true; |
| 32 | 32 | } |