Passed
Push — master ( 586bea...7b9f9c )
by Liam
58s queued 11s
created
src/liamsorsby/Hystrix/Storage/Adapter/AbstractStorage.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -75,8 +75,8 @@  discard block
 block discarded – undo
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
     }
@@ -115,27 +115,27 @@  discard block
 block discarded – undo
115 115
     public function reportFailure(string $service): void
116 116
     {
117 117
         $currentCount = $this->getStorage()->get(
118
-            $this->failurePrefix . $service
118
+            $this->failurePrefix.$service
119 119
         );
120 120
 
121
-        $newTotal = ((int)$currentCount) + 1;
121
+        $newTotal = ((int) $currentCount) + 1;
122 122
 
123 123
         if (!(bool) $currentCount) {
124 124
             $this->getStorage()->set(
125
-                $this->failurePrefix . $service,
125
+                $this->failurePrefix.$service,
126 126
                 1,
127 127
                 $this->duration
128 128
             );
129 129
         } else {
130 130
             $this->getStorage()->set(
131
-                $this->failurePrefix . $service,
131
+                $this->failurePrefix.$service,
132 132
                 $newTotal
133 133
             );
134 134
         }
135 135
 
136 136
         if ($newTotal >= $this->threshold) {
137 137
             $this->getStorage()->set(
138
-                $this->openPrefix . $service,
138
+                $this->openPrefix.$service,
139 139
                 1,
140 140
                 $this->duration
141 141
             );
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
     {
156 156
         try {
157 157
             return (bool) $this->getStorage()->get(
158
-                $this->openPrefix . $service,
158
+                $this->openPrefix.$service,
159 159
                 false
160 160
             );
161 161
         } catch (\Exception $e) {
Please login to merge, or discard this patch.
src/liamsorsby/Hystrix/Storage/StorageFactory.php 1 patch
Switch Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -65,20 +65,20 @@
 block discarded – undo
65 65
         $options = $this->normaliseOptions($options);
66 66
 
67 67
         switch ($storage) {
68
-            case self::APCU:
69
-                return $this->createApcuAdapter($options);
70
-            case self::MEMCACHED:
71
-                return $this->createMemcachedAdapter($options);
72
-            case self::REDIS:
73
-                return $this->createRedisAdapter($options);
74
-            case self::REDIS_ARRAY:
75
-                return $this->createRedisArrayAdapter($options);
76
-            case self::REDIS_CLUSTER:
77
-                return $this->createRedisClusterAdapter($options);
78
-            default:
79
-                throw new \InvalidArgumentException(
80
-                    sprintf('Invalid storage provided: %s', $storage)
81
-                );
68
+        case self::APCU:
69
+            return $this->createApcuAdapter($options);
70
+        case self::MEMCACHED:
71
+            return $this->createMemcachedAdapter($options);
72
+        case self::REDIS:
73
+            return $this->createRedisAdapter($options);
74
+        case self::REDIS_ARRAY:
75
+            return $this->createRedisArrayAdapter($options);
76
+        case self::REDIS_CLUSTER:
77
+            return $this->createRedisClusterAdapter($options);
78
+        default:
79
+            throw new \InvalidArgumentException(
80
+                sprintf('Invalid storage provided: %s', $storage)
81
+            );
82 82
         };
83 83
     }
84 84
 
Please login to merge, or discard this patch.
examples/Apc/index.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-require __DIR__ . '/../../vendor/autoload.php';
3
+require __DIR__.'/../../vendor/autoload.php';
4 4
 
5 5
 use \liamsorsby\Hystrix\Storage\StorageFactory;
6 6
 
Please login to merge, or discard this patch.