Completed
Branch dev (276354)
by Raffael
15:43
created
src/app/Balloon.App.Notification/Hook/NewShareAdded.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 /**
6 6
  * balloon
@@ -105,13 +105,13 @@  discard block
 block discarded – undo
105 105
         $receiver = [];
106 106
         foreach ($node->getAcl() as $rule) {
107 107
             if ('user' === $rule['type']) {
108
-                if (!isset($receiver[(string) $rule['role']->getId()]) && $this->checkNotify($node, $rule['role'])) {
109
-                    $receiver[(string) $rule['role']->getId()] = $rule['role'];
108
+                if (!isset($receiver[(string)$rule['role']->getId()]) && $this->checkNotify($node, $rule['role'])) {
109
+                    $receiver[(string)$rule['role']->getId()] = $rule['role'];
110 110
                 }
111 111
             } elseif ('group' === $rule['type']) {
112 112
                 foreach ($rule['role']->getResolvedMembers() as $user) {
113
-                    if (!isset($receiver[(string) $user->getId()]) && $this->checkNotify($node, $user)) {
114
-                        $receiver[(string) $user->getId()] = $user;
113
+                    if (!isset($receiver[(string)$user->getId()]) && $this->checkNotify($node, $user)) {
114
+                        $receiver[(string)$user->getId()] = $user;
115 115
                     }
116 116
                 }
117 117
             }
Please login to merge, or discard this patch.
src/app/Balloon.App.Notification/Constructor/Http.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 /**
6 6
  * balloon
@@ -35,35 +35,35 @@  discard block
 block discarded – undo
35 35
             ->prependRoute(new Route('/api/v2/nodes|files|collections/subscription(/|\z)', v2\Subscription::class))
36 36
             ->prependRoute(new Route('/api/v2/nodes|files|collections/{id:#([0-9a-z]{24})#}/subscription(/|\z)', v2\Subscription::class));
37 37
 
38
-        $decorator->addDecorator('subscription', function ($node) use ($server) {
38
+        $decorator->addDecorator('subscription', function($node) use ($server) {
39 39
             $subscription = $node->getAppAttribute('Balloon\\App\\Notification', 'subscription');
40 40
 
41 41
             if (is_array($subscription)) {
42
-                return isset($subscription[(string) $server->getIdentity()->getId()]);
42
+                return isset($subscription[(string)$server->getIdentity()->getId()]);
43 43
             }
44 44
 
45 45
             return false;
46 46
         });
47 47
 
48
-        $decorator->addDecorator('subscription_exclude_me', function ($node) use ($server) {
48
+        $decorator->addDecorator('subscription_exclude_me', function($node) use ($server) {
49 49
             $subscription = $node->getAppAttribute('Balloon\\App\\Notification', 'subscription');
50 50
 
51
-            if (is_array($subscription) && isset($subscription[(string) $server->getIdentity()->getId()]['exclude_me'])) {
52
-                return $subscription[(string) $server->getIdentity()->getId()]['exclude_me'];
51
+            if (is_array($subscription) && isset($subscription[(string)$server->getIdentity()->getId()]['exclude_me'])) {
52
+                return $subscription[(string)$server->getIdentity()->getId()]['exclude_me'];
53 53
             }
54 54
 
55 55
             return false;
56 56
         });
57 57
 
58
-        $decorator->addDecorator('subscription_recursive', function ($node) use ($server) {
58
+        $decorator->addDecorator('subscription_recursive', function($node) use ($server) {
59 59
             if (!($node instanceof Collection)) {
60 60
                 return null;
61 61
             }
62 62
 
63 63
             $subscription = $node->getAppAttribute('Balloon\\App\\Notification', 'subscription');
64 64
 
65
-            if (is_array($subscription) && isset($subscription[(string) $server->getIdentity()->getId()]['recursive'])) {
66
-                return $subscription[(string) $server->getIdentity()->getId()]['recursive'];
65
+            if (is_array($subscription) && isset($subscription[(string)$server->getIdentity()->getId()]['recursive'])) {
66
+                return $subscription[(string)$server->getIdentity()->getId()]['recursive'];
67 67
             }
68 68
 
69 69
             return false;
Please login to merge, or discard this patch.
src/app/Balloon.App.Notification/Api/v2/Notifications.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 /**
6 6
  * balloon
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
                     $this->notifier->subscribeNode($this->fs->getNode($id, $p), $subscribe);
292 292
                 } catch (\Exception $e) {
293 293
                     $failures[] = [
294
-                        'id' => (string) $node->getId(),
294
+                        'id' => (string)$node->getId(),
295 295
                         'name' => $node->getName(),
296 296
                         'error' => get_class($e),
297 297
                         'message' => $e->getMessage(),
Please login to merge, or discard this patch.
src/app/Balloon.App.Notification/Api/v2/Subscription.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 /**
6 6
  * balloon
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
         $node_decorator = $this->node_decorator;
83 83
         $notifier = $this->notifier;
84 84
 
85
-        return $this->bulk($id, $p, function ($node) use ($node_decorator, $notifier, $subscribe, $exclude_me, $recursive) {
85
+        return $this->bulk($id, $p, function($node) use ($node_decorator, $notifier, $subscribe, $exclude_me, $recursive) {
86 86
             $notifier->subscribeNode($node, $subscribe, $exclude_me, $recursive);
87 87
 
88 88
             return [
Please login to merge, or discard this patch.
src/app/Balloon.App.Notification/AttributeDecorator.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 /**
6 6
  * balloon
@@ -99,10 +99,10 @@  discard block
 block discarded – undo
99 99
         $role_decorator = $this->role_decorator;
100 100
 
101 101
         return [
102
-            'id' => (string) $message['_id'],
103
-            'message' => (string) $message['body'],
104
-            'subject' => (string) $message['subject'],
105
-            'sender' => function ($message) use ($server, $role_decorator) {
102
+            'id' => (string)$message['_id'],
103
+            'message' => (string)$message['body'],
104
+            'subject' => (string)$message['subject'],
105
+            'sender' => function($message) use ($server, $role_decorator) {
106 106
                 try {
107 107
                     return $role_decorator->decorate($server->getUserById($message['sender']), ['_links', 'id', 'username']);
108 108
                 } catch (\Exception $e) {
Please login to merge, or discard this patch.
src/app/Balloon.App.Api/v2/Nodes.php 2 patches
Indentation   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -279,52 +279,52 @@  discard block
 block discarded – undo
279 279
         }
280 280
 
281 281
         return $response
282
-          ->setOutputFormat(null)
283
-          ->setBody(function () use ($node, $encode, $offset, $limit) {
284
-              $stream = $node->get();
285
-              $name = $node->getName();
282
+            ->setOutputFormat(null)
283
+            ->setBody(function () use ($node, $encode, $offset, $limit) {
284
+                $stream = $node->get();
285
+                $name = $node->getName();
286 286
 
287
-              if (null === $stream) {
288
-                  echo '';
287
+                if (null === $stream) {
288
+                    echo '';
289 289
 
290
-                  return;
291
-              }
290
+                    return;
291
+                }
292 292
 
293
-              if (0 !== $offset) {
294
-                  if (fseek($stream, $offset) === -1) {
295
-                      throw new Exception\Conflict(
293
+                if (0 !== $offset) {
294
+                    if (fseek($stream, $offset) === -1) {
295
+                        throw new Exception\Conflict(
296 296
                         'invalid offset requested',
297 297
                         Exception\Conflict::INVALID_OFFSET
298 298
                     );
299
-                  }
300
-              }
301
-
302
-              $read = 0;
303
-              if ('base64' === $encode) {
304
-                  header('Content-Encoding: base64');
305
-                  while (!feof($stream)) {
306
-                      if (0 !== $limit && $read + 8192 > $limit) {
307
-                          echo base64_encode(fread($stream, $limit - $read));
308
-                          exit();
309
-                      }
310
-
311
-                      echo base64_encode(fread($stream, 8192));
312
-                      $read += 8192;
313
-                  }
314
-              } else {
315
-                  while (!feof($stream)) {
316
-                      if (0 !== $limit && $read + 8192 > $limit) {
317
-                          echo fread($stream, $limit - $read);
318
-                          exit();
319
-                      }
320
-
321
-                      echo fread($stream, 8192);
322
-                      $read += 8192;
323
-                  }
324
-
325
-                  exit();
326
-              }
327
-          });
299
+                    }
300
+                }
301
+
302
+                $read = 0;
303
+                if ('base64' === $encode) {
304
+                    header('Content-Encoding: base64');
305
+                    while (!feof($stream)) {
306
+                        if (0 !== $limit && $read + 8192 > $limit) {
307
+                            echo base64_encode(fread($stream, $limit - $read));
308
+                            exit();
309
+                        }
310
+
311
+                        echo base64_encode(fread($stream, 8192));
312
+                        $read += 8192;
313
+                    }
314
+                } else {
315
+                    while (!feof($stream)) {
316
+                        if (0 !== $limit && $read + 8192 > $limit) {
317
+                            echo fread($stream, $limit - $read);
318
+                            exit();
319
+                        }
320
+
321
+                        echo fread($stream, 8192);
322
+                        $read += 8192;
323
+                    }
324
+
325
+                    exit();
326
+                }
327
+            });
328 328
     }
329 329
 
330 330
     /**
@@ -1129,9 +1129,9 @@  discard block
 block discarded – undo
1129 1129
                 $node->zip($archive);
1130 1130
             } catch (\Exception $e) {
1131 1131
                 $this->logger->debug('failed zip node in multi node request ['.$node->getId().']', [
1132
-                   'category' => get_class($this),
1133
-                   'exception' => $e,
1134
-               ]);
1132
+                    'category' => get_class($this),
1133
+                    'exception' => $e,
1134
+                ]);
1135 1135
             }
1136 1136
         }
1137 1137
 
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 /**
6 6
  * balloon
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
             $result = $this->_getNode($id, $p, null, false, false, $deleted);
123 123
 
124 124
             $response = (new Response())
125
-                ->setHeader('Content-Length', (string) $result->getSize())
125
+                ->setHeader('Content-Length', (string)$result->getSize())
126 126
                 ->setHeader('Content-Type', $result->getContentType())
127 127
                 ->setCode(200);
128 128
 
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
             }
188 188
         }
189 189
 
190
-        return $this->bulk($id, $p, function ($node) use ($parent, $conflict, $move) {
190
+        return $this->bulk($id, $p, function($node) use ($parent, $conflict, $move) {
191 191
             if (true === $move) {
192 192
                 $node = $node->setParent($parent, $conflict);
193 193
             }
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
             $response->setHeader('Content-Disposition', 'attachment; filename*=UTF-8\'\''.rawurlencode($node->getName()));
272 272
             $response->setHeader('Cache-Control', 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0');
273 273
             $response->setHeader('Content-Type', 'application/octet-stream');
274
-            $response->setHeader('Content-Length', (string) $node->getSize());
274
+            $response->setHeader('Content-Length', (string)$node->getSize());
275 275
             $response->setHeader('Content-Transfer-Encoding', 'binary');
276 276
         } else {
277 277
             $response->setHeader('Content-Disposition', 'inline; filename*=UTF-8\'\''.rawurlencode($node->getName()));
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
 
281 281
         return $response
282 282
           ->setOutputFormat(null)
283
-          ->setBody(function () use ($node, $encode, $offset, $limit) {
283
+          ->setBody(function() use ($node, $encode, $offset, $limit) {
284 284
               $stream = $node->get();
285 285
               $name = $node->getName();
286 286
 
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
      */
356 356
     public function postReadonly($id = null, $p = null, bool $readonly = true): Response
357 357
     {
358
-        return $this->bulk($id, $p, function ($node) use ($readonly) {
358
+        return $this->bulk($id, $p, function($node) use ($readonly) {
359 359
             $node->setReadonly($readonly);
360 360
 
361 361
             return [
@@ -586,7 +586,7 @@  discard block
 block discarded – undo
586 586
      */
587 587
     public function patchMeta(array $attributes, ?string $id = null, ?string $p = null): Response
588 588
     {
589
-        return $this->bulk($id, $p, function ($node) use ($attributes) {
589
+        return $this->bulk($id, $p, function($node) use ($attributes) {
590 590
             $node->setMetaAttributes($attributes);
591 591
 
592 592
             return [
@@ -683,7 +683,7 @@  discard block
 block discarded – undo
683 683
             );
684 684
         }
685 685
 
686
-        return $this->bulk($id, $p, function ($node) use ($parent, $conflict) {
686
+        return $this->bulk($id, $p, function($node) use ($parent, $conflict) {
687 687
             $parent = $node->getParent();
688 688
             $result = $node->copyTo($parent, $conflict);
689 689
 
@@ -748,7 +748,7 @@  discard block
 block discarded – undo
748 748
             );
749 749
         }
750 750
 
751
-        return $this->bulk($id, $p, function ($node) use ($parent, $conflict) {
751
+        return $this->bulk($id, $p, function($node) use ($parent, $conflict) {
752 752
             $result = $node->setParent($parent, $conflict);
753 753
 
754 754
             return [
@@ -802,7 +802,7 @@  discard block
 block discarded – undo
802 802
             $at = $this->_verifyAttributes(['destroy' => $at])['destroy'];
803 803
         }
804 804
 
805
-        return $this->bulk($id, $p, function ($node) use ($force, $ignore_flag, $at) {
805
+        return $this->bulk($id, $p, function($node) use ($force, $ignore_flag, $at) {
806 806
             if (null === $at) {
807 807
                 $node->delete($force && $node->isDeleted() || $force && $ignore_flag);
808 808
             } else {
@@ -1171,7 +1171,7 @@  discard block
 block discarded – undo
1171 1171
         foreach ($attributes as $attribute => $value) {
1172 1172
             switch ($attribute) {
1173 1173
                 case 'filter':
1174
-                    $attributes['filter'] = json_encode((array) $attributes['filter']);
1174
+                    $attributes['filter'] = json_encode((array)$attributes['filter']);
1175 1175
 
1176 1176
                 break;
1177 1177
                 case 'destroy':
@@ -1186,14 +1186,14 @@  discard block
 block discarded – undo
1186 1186
                     if (!Helper::isValidTimestamp($value)) {
1187 1187
                         throw new Exception\InvalidArgument($attribute.' Changed timestamp must be valid unix timestamp');
1188 1188
                     }
1189
-                    if ((int) $value > time()) {
1189
+                    if ((int)$value > time()) {
1190 1190
                         throw new Exception\InvalidArgument($attribute.' timestamp can not be set greater than the server time');
1191 1191
                     }
1192 1192
                     $attributes[$attribute] = new UTCDateTime($value.'000');
1193 1193
 
1194 1194
                 break;
1195 1195
                 case 'readonly':
1196
-                    $attributes['readonly'] = (bool) $attributes['readonly'];
1196
+                    $attributes['readonly'] = (bool)$attributes['readonly'];
1197 1197
 
1198 1198
                 break;
1199 1199
             }
Please login to merge, or discard this patch.
src/app/Balloon.App.Api/v1/AttributeDecorator/NodeDecorator.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 /**
6 6
  * balloon
@@ -136,37 +136,37 @@  discard block
 block discarded – undo
136 136
         $fs = $this->server->getFilesystem();
137 137
 
138 138
         return [
139
-            'id' => (string) $attributes['_id'],
140
-            'name' => (string) $attributes['name'],
141
-            'mime' => (string) $attributes['mime'],
142
-            'readonly' => (bool) $attributes['readonly'],
139
+            'id' => (string)$attributes['_id'],
140
+            'name' => (string)$attributes['name'],
141
+            'mime' => (string)$attributes['mime'],
142
+            'readonly' => (bool)$attributes['readonly'],
143 143
             'directory' => $node instanceof Collection,
144
-            'meta' => function ($node) {
145
-                return (object) $node->getMetaAttributes();
144
+            'meta' => function($node) {
145
+                return (object)$node->getMetaAttributes();
146 146
             },
147
-            'size' => function ($node) {
147
+            'size' => function($node) {
148 148
                 return $node->getSize();
149 149
             },
150
-            'path' => function ($node) {
150
+            'path' => function($node) {
151 151
                 try {
152 152
                     return $node->getPath();
153 153
                 } catch (\Exception $e) {
154 154
                     return null;
155 155
                 }
156 156
             },
157
-            'parent' => function ($node) {
157
+            'parent' => function($node) {
158 158
                 $id = $node->getAttributes()['parent'];
159 159
 
160 160
                 if (null === $id) {
161 161
                     return null;
162 162
                 }
163 163
 
164
-                return (string) $id;
164
+                return (string)$id;
165 165
             },
166
-            'access' => function ($node) use ($acl) {
166
+            'access' => function($node) use ($acl) {
167 167
                 return $acl->getAclPrivilege($node);
168 168
             },
169
-            'share' => function ($node) {
169
+            'share' => function($node) {
170 170
                 if ($node->isShared() || !$node->isSpecial()) {
171 171
                     return null;
172 172
                 }
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
                     return null;
178 178
                 }
179 179
             },
180
-            'shareowner' => function ($node) use ($server, $fs) {
180
+            'shareowner' => function($node) use ($server, $fs) {
181 181
                 if (!$node->isSpecial()) {
182 182
                     return null;
183 183
                 }
@@ -223,20 +223,20 @@  discard block
 block discarded – undo
223 223
     protected function getTimeAttributes(NodeInterface $node, array $attributes): array
224 224
     {
225 225
         return [
226
-            'created' => function ($node) use ($attributes) {
226
+            'created' => function($node) use ($attributes) {
227 227
                 return $this->dateTimeToUnix($attributes['created']);
228 228
             },
229
-            'changed' => function ($node) use ($attributes) {
229
+            'changed' => function($node) use ($attributes) {
230 230
                 return $this->dateTimeToUnix($attributes['changed']);
231 231
             },
232
-            'deleted' => function ($node) use ($attributes) {
232
+            'deleted' => function($node) use ($attributes) {
233 233
                 if (false === $attributes['deleted']) {
234 234
                     return false;
235 235
                 }
236 236
 
237 237
                 return $this->dateTimeToUnix($attributes['destroy']);
238 238
             },
239
-            'destroy' => function ($node) use ($attributes) {
239
+            'destroy' => function($node) use ($attributes) {
240 240
                 if (null === $attributes['destroy']) {
241 241
                     return null;
242 242
                 }
Please login to merge, or discard this patch.
src/app/Balloon.App.Api/v1/AttributeDecorator/RoleDecorator.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 /**
6 6
  * balloon
@@ -105,13 +105,13 @@  discard block
 block discarded – undo
105 105
         }
106 106
 
107 107
         return [
108
-            'created' => function ($role, $requested) use ($attributes) {
108
+            'created' => function($role, $requested) use ($attributes) {
109 109
                 return $attributes['created']->toDateTime()->format('c');
110 110
             },
111
-            'changed' => function ($role, $requested) use ($attributes) {
111
+            'changed' => function($role, $requested) use ($attributes) {
112 112
                 return $attributes['changed']->toDateTime()->format('c');
113 113
             },
114
-            'deleted' => function ($role, $requested) use ($attributes) {
114
+            'deleted' => function($role, $requested) use ($attributes) {
115 115
                 if (false === $attributes['deleted']) {
116 116
                     return null;
117 117
                 }
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
         }
137 137
 
138 138
         return [
139
-            'id' => (string) $attributes['_id'],
139
+            'id' => (string)$attributes['_id'],
140 140
             'name' => $attributes['name'],
141 141
             'namespace' => $attributes['namespace'],
142 142
         ];
@@ -159,19 +159,19 @@  discard block
 block discarded – undo
159 159
         $user = $this->server->getIdentity();
160 160
 
161 161
         return [
162
-            'id' => (string) $attributes['_id'],
163
-            'username' => (string) $attributes['username'],
164
-            'name' => (string) $attributes['username'],
165
-            'namespace' => (string) $attributes['namespace'],
166
-            'mail' => (string) $attributes['mail'],
167
-            'avatar' => function ($role, $requested) use ($attributes) {
162
+            'id' => (string)$attributes['_id'],
163
+            'username' => (string)$attributes['username'],
164
+            'name' => (string)$attributes['username'],
165
+            'namespace' => (string)$attributes['namespace'],
166
+            'mail' => (string)$attributes['mail'],
167
+            'avatar' => function($role, $requested) use ($attributes) {
168 168
                 if ($attributes['avatar'] instanceof Binary) {
169 169
                     return base64_encode($attributes['avatar']->getData());
170 170
                 }
171 171
 
172 172
                 return null;
173 173
             },
174
-            'soft_quota' => function ($role, $requested) use ($attributes, $user) {
174
+            'soft_quota' => function($role, $requested) use ($attributes, $user) {
175 175
                 if ($user === null) {
176 176
                     return null;
177 177
                 }
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
 
183 183
                 return null;
184 184
             },
185
-            'hard_quota' => function ($role, $requested) use ($attributes, $user) {
185
+            'hard_quota' => function($role, $requested) use ($attributes, $user) {
186 186
                 if ($user === null) {
187 187
                     return null;
188 188
                 }
Please login to merge, or discard this patch.
src/app/Balloon.App.Api/v1/Collection.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 /**
6 6
  * balloon
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
                 'type' => $rule['role'] instanceof User ? 'user' : 'group',
182 182
                 'priv' => $rule['privilege'],
183 183
                 'name' => $role['name'],
184
-                'id' => (string) $rule['id'],
184
+                'id' => (string)$rule['id'],
185 185
             ];
186 186
         }
187 187
 
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
 
351 351
             return (new Response())->setCode(201)->setBody([
352 352
                 'code' => 201,
353
-                'data' => (string) $result,
353
+                'data' => (string)$result,
354 354
             ]);
355 355
         }
356 356
         if (null !== $id && null === $name) {
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
 
367 367
         return (new Response())->setCode(201)->setBody([
368 368
             'code' => 201,
369
-            'data' => (string) $result,
369
+            'data' => (string)$result,
370 370
         ]);
371 371
     }
372 372
 }
Please login to merge, or discard this patch.