@@ -75,8 +75,8 @@ discard block |
||
| 75 | 75 | */ |
| 76 | 76 | public function __construct(string $prefix, int $threshold, int $duration) |
| 77 | 77 | { |
| 78 | - $this->failurePrefix = $prefix . 'failcount'; |
|
| 79 | - $this->openPrefix = $prefix . 'open'; |
|
| 78 | + $this->failurePrefix = $prefix.'failcount'; |
|
| 79 | + $this->openPrefix = $prefix.'open'; |
|
| 80 | 80 | $this->duration = $duration; |
| 81 | 81 | $this->threshold = $threshold; |
| 82 | 82 | } |
@@ -113,27 +113,27 @@ discard block |
||
| 113 | 113 | public function reportFailure(string $service, string $value): void |
| 114 | 114 | { |
| 115 | 115 | $currentCount = $this->getStorage()->get( |
| 116 | - $this->failurePrefix . $service |
|
| 116 | + $this->failurePrefix.$service |
|
| 117 | 117 | ); |
| 118 | 118 | |
| 119 | - $newTotal = ((int)$currentCount)+1; |
|
| 119 | + $newTotal = ((int) $currentCount) + 1; |
|
| 120 | 120 | |
| 121 | 121 | if (!(bool) $currentCount) { |
| 122 | 122 | $this->getStorage()->set( |
| 123 | - $this->failurePrefix . $service, |
|
| 123 | + $this->failurePrefix.$service, |
|
| 124 | 124 | 1, |
| 125 | 125 | $this->duration |
| 126 | 126 | ); |
| 127 | 127 | } else { |
| 128 | 128 | $this->getStorage()->set( |
| 129 | - $this->failurePrefix . $service, |
|
| 129 | + $this->failurePrefix.$service, |
|
| 130 | 130 | $newTotal |
| 131 | 131 | ); |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | if ($newTotal >= $this->threshold) { |
| 135 | 135 | $this->getStorage()->set( |
| 136 | - $this->openPrefix . $service, |
|
| 136 | + $this->openPrefix.$service, |
|
| 137 | 137 | 1, |
| 138 | 138 | $this->duration |
| 139 | 139 | ); |