Passed
Pull Request — master (#9)
by Leonardo
01:33
created
examples/CircuitBreakerRedisAdapterExample.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -14,18 +14,18 @@
 block discarded – undo
14 14
 CircuitBreaker::setGlobalSettings([
15 15
     'timeWindow' => 60, // Time for an open circuit (seconds)
16 16
     'failureRateThreshold' => 50, // Fail rate for open the circuit
17
-    'intervalToHalfOpen' => 30,  // Half open time (seconds)
17
+    'intervalToHalfOpen' => 30, // Half open time (seconds)
18 18
 ]);
19 19
 
20 20
 // Configure settings for specific service
21 21
 CircuitBreaker::setServiceSettings('my-custom-service', [
22 22
     'timeWindow' => 30, // Time for an open circuit (seconds)
23 23
     'failureRateThreshold' => 15, // Fail rate for open the circuit
24
-    'intervalToHalfOpen' => 10,  // Half open time (seconds)
24
+    'intervalToHalfOpen' => 10, // Half open time (seconds)
25 25
 ]);
26 26
 
27 27
 // Check circuit status for service: `my-service`
28
-if (! CircuitBreaker::isAvailable('my-service')) {
28
+if (!CircuitBreaker::isAvailable('my-service')) {
29 29
     die('Circuit is not available!');
30 30
 }
31 31
 
Please login to merge, or discard this patch.
src/Adapters/RedisAdapter.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
     protected function validateRedisInstance($redis)
42 42
     {
43 43
         if (! $redis instanceof Redis && ! $redis instanceof RedisCluster) {
44
-          throw new \InvalidArgumentException('Redis is not a valid instance.');
44
+            throw new \InvalidArgumentException('Redis is not a valid instance.');
45 45
         }
46 46
     }
47 47
 
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 
41 41
     protected function validateRedisInstance($redis)
42 42
     {
43
-        if (! $redis instanceof Redis && ! $redis instanceof RedisCluster) {
43
+        if (!$redis instanceof Redis && !$redis instanceof RedisCluster) {
44 44
           throw new \InvalidArgumentException('Redis is not a valid instance.');
45 45
         }
46 46
     }
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
     {
85 85
         $serviceName = $this->makeNamespace($service) . ':failures';
86 86
 
87
-        if (! $this->redis->get($serviceName)) {
87
+        if (!$this->redis->get($serviceName)) {
88 88
             $this->redis->multi();
89 89
             $this->redis->incr($serviceName);
90 90
             $this->redis->expire($serviceName, CircuitBreaker::getServiceSetting($service, 'timeWindow'));
Please login to merge, or discard this patch.