@@ -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) |
@@ -25,14 +25,14 @@ discard block |
||
| 25 | 25 | self::ONE_SECOND |
| 26 | 26 | ); |
| 27 | 27 | |
| 28 | - $storage->setNumberOfFailures(self::SERVICE_NAME, self::MAX_FAILURES- self::MAX_FAILURES); |
|
| 28 | + $storage->setNumberOfFailures(self::SERVICE_NAME, self::MAX_FAILURES-self::MAX_FAILURES); |
|
| 29 | 29 | $this->assertTrue($strategy->isAvailable(self::SERVICE_NAME)); |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | /** @test */ |
| 33 | 33 | public function it_reports_as_non_available_between_attempts() |
| 34 | 34 | { |
| 35 | - $storage = new InMemoryStorage();; |
|
| 35 | + $storage = new InMemoryStorage(); ; |
|
| 36 | 36 | $backoffStrategy = $this->prophesize(BackoffStrategy::class); |
| 37 | 37 | $strategy = new TimeBackoff( |
| 38 | 38 | $storage, |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | ); |
| 66 | 66 | |
| 67 | 67 | $storage->setNumberOfFailures(self::SERVICE_NAME, self::MAX_FAILURES); |
| 68 | - $oneSecAndOneMillisecond = floor((microtime(true) * 1000)) - 1001; |
|
| 68 | + $oneSecAndOneMillisecond = floor((microtime(true) * 1000))-1001; |
|
| 69 | 69 | $storage->saveStrategyData( |
| 70 | 70 | $strategy, |
| 71 | 71 | self::SERVICE_NAME, |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | $strategy, |
| 114 | 114 | self::SERVICE_NAME, |
| 115 | 115 | self::LAST_ATTEMPT_KEY, |
| 116 | - floor(microtime(true) * 1000) - self::ONE_SECOND); |
|
| 116 | + floor(microtime(true) * 1000)-self::ONE_SECOND); |
|
| 117 | 117 | |
| 118 | 118 | $strategy->isAvailable(self::SERVICE_NAME); |
| 119 | 119 | $this->assertEquals(1, $storage->getStrategyData($strategy, self::SERVICE_NAME, "attempts")); |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | $strategy, |
| 124 | 124 | self::SERVICE_NAME, |
| 125 | 125 | self::LAST_ATTEMPT_KEY, |
| 126 | - floor(microtime(true) * 1000) - self::ONE_SECOND); |
|
| 126 | + floor(microtime(true) * 1000)-self::ONE_SECOND); |
|
| 127 | 127 | $strategy->isAvailable(self::SERVICE_NAME); |
| 128 | 128 | $this->assertEquals(2, $storage->getStrategyData($strategy, self::SERVICE_NAME, "attempts")); |
| 129 | 129 | } |
@@ -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( |