Passed
Branch master (053207)
by frey
03:43
created
src/Queue/CMQQueue.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
50 50
     {
51 51
         $attributes = $this->getQueue($queue)->get_attributes();
52 52
 
53
-        return (int) $attributes->activeMsgNum;
53
+        return (int)$attributes->activeMsgNum;
54 54
     }
55 55
 
56 56
     /**
Please login to merge, or discard this patch.
src/Queue/Driver/CMQHttp.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,8 +41,9 @@
 block discarded – undo
41 41
         if (!$this->keep_alive) {
42 42
             $this->curl = curl_init();
43 43
         } else {
44
-            if ($this->curl == NULL)
45
-                $this->curl = curl_init();
44
+            if ($this->curl == NULL) {
45
+                            $this->curl = curl_init();
46
+            }
46 47
         }
47 48
 
48 49
         if ($this->curl == NULL) {
Please login to merge, or discard this patch.
src/Queue/Driver/Queue.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
         } else {
187 187
             $msgBody = $message->msgBody;
188 188
         }
189
-        $params        = array(
189
+        $params = array(
190 190
             'queueName'    => $this->queue_name,
191 191
             'msgBody'      => $msgBody,
192 192
             'delaySeconds' => $delayTime
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
             'queueName'    => $this->queue_name,
213 213
             'delaySeconds' => $delayTime
214 214
         );
215
-        $n      = 1;
215
+        $n = 1;
216 216
         foreach ($messages as $message) {
217 217
             $key = 'msgBody.' . $n;
218 218
             if ($this->encoding) {
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
         foreach ($receipt_handle_list as $receipt_handle) {
325 325
             $key          = 'receiptHandle.' . $n;
326 326
             $params[$key] = $receipt_handle;
327
-            $n            += 1;
327
+            $n += 1;
328 328
         }
329 329
         $this->cmq_client->batch_delete_message($params);
330 330
     }
Please login to merge, or discard this patch.
src/Queue/Driver/CMQClient.php 1 patch
Braces   +19 added lines, -14 removed lines patch added patch discarded remove patch
@@ -41,12 +41,13 @@  discard block
 block discarded – undo
41 41
 
42 42
     public function set_sign_method($sign_method = 'sha1')
43 43
     {
44
-        if ($sign_method == 'sha1' || $sign_method == 'HmacSHA256')
45
-            $this->sign_method = 'HmacSHA1';
46
-        elseif ($sign_method == 'sha256')
47
-            $this->sign_method = 'HmacSHA256';
48
-        else
49
-            throw new CMQClientParameterException('Only support sign method HmasSHA256 or HmacSHA1 . Invalid sign method:' . $sign_method);
44
+        if ($sign_method == 'sha1' || $sign_method == 'HmacSHA256') {
45
+                    $this->sign_method = 'HmacSHA1';
46
+        } elseif ($sign_method == 'sha256') {
47
+                    $this->sign_method = 'HmacSHA256';
48
+        } else {
49
+                    throw new CMQClientParameterException('Only support sign method HmasSHA256 or HmacSHA1 . Invalid sign method:' . $sign_method);
50
+        }
50 51
 
51 52
     }
52 53
 
@@ -94,17 +95,21 @@  discard block
 block discarded – undo
94 95
         $_params['Action']        = ucfirst($action);
95 96
         $_params['RequestClient'] = $this->version;
96 97
 
97
-        if (!isset($_params['SecretId']))
98
-            $_params['SecretId'] = $this->secretId;
98
+        if (!isset($_params['SecretId'])) {
99
+                    $_params['SecretId'] = $this->secretId;
100
+        }
99 101
 
100
-        if (!isset($_params['Nonce']))
101
-            $_params['Nonce'] = rand(1, 65535);
102
+        if (!isset($_params['Nonce'])) {
103
+                    $_params['Nonce'] = rand(1, 65535);
104
+        }
102 105
 
103
-        if (!isset($_params['Timestamp']))
104
-            $_params['Timestamp'] = time();
106
+        if (!isset($_params['Timestamp'])) {
107
+                    $_params['Timestamp'] = time();
108
+        }
105 109
 
106
-        if (!isset($_params['SignatureMethod']))
107
-            $_params['SignatureMethod'] = $this->sign_method;
110
+        if (!isset($_params['SignatureMethod'])) {
111
+                    $_params['SignatureMethod'] = $this->sign_method;
112
+        }
108 113
 
109 114
         $plainText            = Signature::makeSignPlainText($_params,
110 115
             $this->method, $this->host, $req_inter->uri);
Please login to merge, or discard this patch.
src/Queue/Driver/Subscription.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
             foreach ($subscription_meta->bindindKey as $tag) {
47 47
                 $key          = 'bindindKey.' . $n;
48 48
                 $params[$key] = $tag;
49
-                $n            += 1;
49
+                $n += 1;
50 50
             }
51 51
         }
52 52
 
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
             foreach ($subscription_meta->FilterTag as $tag) {
56 56
                 $key          = 'filterTag.' . $n;
57 57
                 $params[$key] = $tag;
58
-                $n            += 1;
58
+                $n += 1;
59 59
             }
60 60
         }
61 61
         $this->cmq_client->create_subscription($params);
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
             foreach ($subscription_meta->bindindKey as $tag) {
172 172
                 $key          = 'bindindKey.' . $n;
173 173
                 $params[$key] = $tag;
174
-                $n            += 1;
174
+                $n += 1;
175 175
             }
176 176
         }
177 177
 
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
             foreach ($subscription_meta->FilterTag as $tag) {
181 181
                 $key          = 'filterTag.' . $n;
182 182
                 $params[$key] = $tag;
183
-                $n            += 1;
183
+                $n += 1;
184 184
             }
185 185
         }
186 186
 
Please login to merge, or discard this patch.
src/Queue/Driver/Topic.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
             foreach ($vTagList as $tag) {
148 148
                 $key          = 'msgTag.' . $n;
149 149
                 $params[$key] = $tag;
150
-                $n            += 1;
150
+                $n += 1;
151 151
             }
152 152
         }
153 153
         $msgId = $this->cmq_client->publish_message($params);
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
             foreach ($vtagList as $tag) {
200 200
                 $key          = 'msgTag.' . $n;
201 201
                 $params[$key] = $tag;
202
-                $n            += 1;
202
+                $n += 1;
203 203
             }
204 204
         }
205 205
 
Please login to merge, or discard this patch.
src/Queue/Connectors/CMQConnector.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
 
35 35
         $topic = new Account(array_get($config, 'options.topic.host'), $config['secret_id'], $config['secret_key']);
36 36
 
37
-        $this->dispatcher->listen(WorkerStopping::class, function () {
37
+        $this->dispatcher->listen(WorkerStopping::class, function() {
38 38
             //
39 39
         });
40 40
 
Please login to merge, or discard this patch.
src/LaravelQueueCMQServiceProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
         /** @var QueueManager $queue */
31 31
         $queue = $this->app['queue'];
32 32
 
33
-        $queue->addConnector('cmq', function () {
33
+        $queue->addConnector('cmq', function() {
34 34
             return new CMQConnector($this->app['events']);
35 35
         });
36 36
     }
Please login to merge, or discard this patch.