@@ -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); |
@@ -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, |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | $this->setFailuresToMaxAllowed(); |
| 107 | 107 | $this->maxWaitTimeHaveOccurred(); |
| 108 | 108 | $this->backoffStrategy->waitTime(Argument::any(), self::BASE_WAIT_TIME) |
| 109 | - ->willReturn(self::MAX_WAIT_TIME + 1); |
|
| 109 | + ->willReturn(self::MAX_WAIT_TIME+1); |
|
| 110 | 110 | |
| 111 | 111 | $this->assertTrue($this->sut->isAvailable(self::SERVICE_NAME)); |
| 112 | 112 | } |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | { |
| 124 | 124 | $this->storage->setNumberOfFailures( |
| 125 | 125 | self::SERVICE_NAME, |
| 126 | - self::MAX_FAILURES - 1 |
|
| 126 | + self::MAX_FAILURES-1 |
|
| 127 | 127 | ); |
| 128 | 128 | } |
| 129 | 129 | |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | $this->sut, |
| 136 | 136 | self::SERVICE_NAME, |
| 137 | 137 | self::LAST_ATTEMPT_KEY, |
| 138 | - floor(microtime(true) * 1000) - 1); |
|
| 138 | + floor(microtime(true) * 1000)-1); |
|
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | private function maxWaitTimeHaveOccurred() |
@@ -144,6 +144,6 @@ discard block |
||
| 144 | 144 | $this->sut, |
| 145 | 145 | self::SERVICE_NAME, |
| 146 | 146 | self::LAST_ATTEMPT_KEY, |
| 147 | - floor(microtime(true) * 1000) - self::MAX_WAIT_TIME); |
|
| 147 | + floor(microtime(true) * 1000)-self::MAX_WAIT_TIME); |
|
| 148 | 148 | } |
| 149 | 149 | } |
@@ -77,7 +77,7 @@ |
||
| 77 | 77 | private function millisecondsSinceLastAttempt(string $serviceName): int |
| 78 | 78 | { |
| 79 | 79 | $lastAttempt = $this->getLastAttemptTime($serviceName); |
| 80 | - return $this->now() - $lastAttempt; |
|
| 80 | + return $this->now()-$lastAttempt; |
|
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | private function now(): int |
@@ -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 | |