Completed
Pull Request — master (#39)
by Will
04:15
created
src/Message/MessageFactory.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
     }
29 29
 
30 30
     /**
31
-     * @return callable
31
+     * @return ImmutableContainer
32 32
      */
33 33
     protected function getMetadata(array $options)
34 34
     {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
      */
43 43
     protected function getValidator(array $options)
44 44
     {
45
-        return isset($options['validator']) ? $options['validator'] : function (MessageInterface $message) {
45
+        return isset($options['validator']) ? $options['validator'] : function(MessageInterface $message) {
46 46
             return true;
47 47
         };
48 48
     }
Please login to merge, or discard this patch.
src/Adapter/SqsAdapter.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -104,14 +104,14 @@  discard block
 block discarded – undo
104 104
                 'Entries' => $batch,
105 105
             ]);
106 106
 
107
-            $map = function ($result) use ($messages) {
107
+            $map = function($result) use ($messages) {
108 108
                 return $messages[$result['Id']];
109 109
             };
110 110
 
111 111
             $failed = array_merge($failed, array_map($map, $results->get('Failed') ?: []));
112 112
         }
113 113
 
114
-        if (! empty($failed)) {
114
+        if (!empty($failed)) {
115 115
             throw new FailedAcknowledgementException($this, $failed);
116 116
         }
117 117
     }
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
             $size = ($limit !== null) ? min($remaining, self::BATCHSIZE_RECEIVE) : self::BATCHSIZE_RECEIVE;
134 134
 
135 135
             $timestamp = time() + $this->getQueueVisibilityTimeout();
136
-            $validator = function () use ($timestamp) {
136
+            $validator = function() use ($timestamp) {
137 137
                 return time() < $timestamp;
138 138
             };
139 139
 
@@ -178,14 +178,14 @@  discard block
 block discarded – undo
178 178
                 'Entries' => $batch,
179 179
             ]);
180 180
 
181
-            $map = function ($result) use ($messages) {
181
+            $map = function($result) use ($messages) {
182 182
                 return $messages[$result['Id']];
183 183
             };
184 184
 
185 185
             $failed = array_merge($failed, array_map($map, $results->get('Failed') ?: []));
186 186
         }
187 187
 
188
-        if (! empty($failed)) {
188
+        if (!empty($failed)) {
189 189
             throw new FailedEnqueueException($this, $failed);
190 190
         }
191 191
     }
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
      */
214 214
     protected function createDeleteEntries(array $messages)
215 215
     {
216
-        array_walk($messages, function (MessageInterface &$message, $id) {
216
+        array_walk($messages, function(MessageInterface&$message, $id) {
217 217
             $metadata = $message->getMetadata();
218 218
             $message = [
219 219
                 'Id' => $id,
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
      */
232 232
     protected function createEnqueueEntries(array $messages)
233 233
     {
234
-        array_walk($messages, function (MessageInterface &$message, $id) {
234
+        array_walk($messages, function(MessageInterface&$message, $id) {
235 235
             $metadata = $message->getMetadata();
236 236
             $message = [
237 237
                 'Id' => $id,
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
      */
278 278
     protected function getQueueUrl()
279 279
     {
280
-        if (! $this->url) {
280
+        if (!$this->url) {
281 281
             $result = $this->client->createQueue([
282 282
                 'QueueName' => $this->name,
283 283
                 'Attributes' => $this->options,
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
      */
295 295
     protected function getQueueVisibilityTimeout()
296 296
     {
297
-        if (! isset($this->options['VisibilityTimeout'])) {
297
+        if (!isset($this->options['VisibilityTimeout'])) {
298 298
             $result = $this->client->getQueueAttributes([
299 299
                 'QueueUrl' => $this->getQueueUrl(),
300 300
                 'AttributeNames' => ['VisibilityTimeout'],
Please login to merge, or discard this patch.
src/Adapter/ArrayAdapter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@
 block discarded – undo
40 40
      */
41 41
     public function acknowledge(array $messages)
42 42
     {
43
-        $this->queue = array_values(array_filter($this->queue, function ($message) use ($messages) {
43
+        $this->queue = array_values(array_filter($this->queue, function($message) use ($messages) {
44 44
             return false === array_search($message, $messages, true);
45 45
         }));
46 46
     }
Please login to merge, or discard this patch.
src/Handler/BatchAcknowledgementHandler.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@
 block discarded – undo
58 58
      */
59 59
     protected function flush(AdapterInterface $adapter)
60 60
     {
61
-        if (! empty($this->messages)) {
61
+        if (!empty($this->messages)) {
62 62
             $adapter->acknowledge($this->messages);
63 63
 
64 64
             $this->messages = [];
Please login to merge, or discard this patch.
src/Handler/AbstractAcknowledgementHandler.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@
 block discarded – undo
47 47
     {
48 48
         // Used to break from polling consumer
49 49
         $break = false;
50
-        $done = function () use (&$break) {
50
+        $done = function() use (&$break) {
51 51
             $break = true;
52 52
         };
53 53
 
Please login to merge, or discard this patch.