@@ -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); |
@@ -72,7 +72,7 @@ |
||
| 72 | 72 | ); |
| 73 | 73 | $this->assertEquals( |
| 74 | 74 | "a_value", |
| 75 | - $storage->getStrategyData($strategy->reveal(), self::SERVICE_NAME,"a_key") |
|
| 75 | + $storage->getStrategyData($strategy->reveal(), self::SERVICE_NAME, "a_key") |
|
| 76 | 76 | ); |
| 77 | 77 | } |
| 78 | 78 | |
@@ -78,7 +78,7 @@ |
||
| 78 | 78 | private function millisecondsSinceLastAttempt(string $serviceName): int |
| 79 | 79 | { |
| 80 | 80 | $lastAttempt = $this->getLastAttemptTime($serviceName); |
| 81 | - return $this->now() - $lastAttempt; |
|
| 81 | + return $this->now()-$lastAttempt; |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | private function saveAttempt(string $serviceName, int $attempt) |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | $this->strategyData[$strategy->getId()][$serviceName] = []; |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | - $this->strategyData[$strategy->getId()][$serviceName][$key] = $value; |
|
| 40 | + $this->strategyData[$strategy->getId()][$serviceName][$key] = $value; |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | public function getStrategyData( |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | public function it_closes_the_circuit_after_timeout() |
| 62 | 62 | { |
| 63 | 63 | $this->setFailuresToMaxAllowed(); |
| 64 | - $oneSecAndOneMillisecond = floor((microtime(true) * 1000)) - self::BASE_WAIT_TIME - 1; |
|
| 64 | + $oneSecAndOneMillisecond = floor((microtime(true) * 1000))-self::BASE_WAIT_TIME-1; |
|
| 65 | 65 | $this->storage->saveStrategyData( |
| 66 | 66 | $this->sut, |
| 67 | 67 | self::SERVICE_NAME, |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | { |
| 113 | 113 | $this->storage->setNumberOfFailures( |
| 114 | 114 | self::SERVICE_NAME, |
| 115 | - self::MAX_FAILURES - 1 |
|
| 115 | + self::MAX_FAILURES-1 |
|
| 116 | 116 | ); |
| 117 | 117 | } |
| 118 | 118 | |
@@ -124,6 +124,6 @@ discard block |
||
| 124 | 124 | $this->sut, |
| 125 | 125 | self::SERVICE_NAME, |
| 126 | 126 | self::LAST_ATTEMPT_KEY, |
| 127 | - floor(microtime(true) * 1000) - 1); |
|
| 127 | + floor(microtime(true) * 1000)-1); |
|
| 128 | 128 | } |
| 129 | 129 | } |