Passed
Push — master ( b66c10...181037 )
by y
02:15
created
src/Api.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -460,8 +460,7 @@
 block discarded – undo
460 460
                 'sync' => $token,
461 461
                 'opt_expand' => 'this'
462 462
             ]));
463
-        }
464
-        catch (Error $error) {
463
+        } catch (Error $error) {
465 464
             if ($error->getCode() !== 412) {
466 465
                 throw $error;
467 466
             }
Please login to merge, or discard this patch.
src/Task/CustomValues.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -41,11 +41,9 @@
 block discarded – undo
41 41
             if ($field['type'] === CustomField::TYPE_ENUM) {
42 42
                 $this->optionNames[$gid] = array_column($field['enum_options'], 'name', 'gid');
43 43
                 $this->data[$gid] = $field['enum_value']['gid'];
44
-            }
45
-            elseif ($field['type'] === CustomField::TYPE_TEXT) {
44
+            } elseif ($field['type'] === CustomField::TYPE_TEXT) {
46 45
                 $this->data[$gid] = $field['text_value'];
47
-            }
48
-            elseif ($field['type'] === CustomField::TYPE_NUMBER) {
46
+            } elseif ($field['type'] === CustomField::TYPE_NUMBER) {
49 47
                 $this->data[$gid] = $field['number_value'];
50 48
             }
51 49
         }
Please login to merge, or discard this patch.
src/Color.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,8 +39,7 @@
 block discarded – undo
39 39
         try {
40 40
             $colors = (new ReflectionClass(self::class))->getConstants();
41 41
             return $colors[array_rand($colors)];
42
-        }
43
-        catch (Exception $exception) {
42
+        } catch (Exception $exception) {
44 43
             return 'none'; // unreachable
45 44
         }
46 45
     }
Please login to merge, or discard this patch.
src/Base/AbstractEntity.php 1 patch
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -87,11 +87,9 @@  discard block
 block discarded – undo
87 87
     protected function _removeWithPost (string $path, array $data, string $field = null, $diff = null) {
88 88
         if ($this->hasGid()) {
89 89
             return $this->_setWithPost($path, $data, $field);
90
-        }
91
-        elseif (is_array($diff)) {
90
+        } elseif (is_array($diff)) {
92 91
             $this->_set($field, array_values(array_diff($this->data[$field] ?? [], $diff)));
93
-        }
94
-        elseif ($diff instanceof Closure) {
92
+        } elseif ($diff instanceof Closure) {
95 93
             $this->_set($field, array_filter($diff, $this->data[$field] ?? []));
96 94
         }
97 95
         return $this;
@@ -107,11 +105,9 @@  discard block
 block discarded – undo
107 105
     protected function _save (string $dir = null) {
108 106
         if (isset($dir)) {
109 107
             $remote = $this->api->post($dir, $this->getDiff(), ['expand' => 'this']);
110
-        }
111
-        elseif ($this->isDiff()) {
108
+        } elseif ($this->isDiff()) {
112 109
             $remote = $this->api->put($this, $this->getDiff(), ['expand' => 'this']);
113
-        }
114
-        else {
110
+        } else {
115 111
             return $this;
116 112
         }
117 113
         /** @var array $remote */
@@ -162,8 +158,7 @@  discard block
 block discarded – undo
162 158
         if (isset($field)) {
163 159
             $value = $this->api->get($this, [], ['fields' => static::$optFields[$field] ?? $field])[$field] ?? null;
164 160
             $this->_setMapped($field, $value);
165
-        }
166
-        else {
161
+        } else {
167 162
             $this->_setData($this->api->get($this, [], ['expand' => 'this']));
168 163
         }
169 164
         $this->_cache();
Please login to merge, or discard this patch.
src/Base/Data.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -218,8 +218,7 @@  discard block
 block discarded – undo
218 218
         if (is_array($class)) {
219 219
             $class = $class[0];
220 220
             $this->data[$field] = array_map($hydrate, $value);
221
-        }
222
-        else {
221
+        } else {
223 222
             $this->data[$field] = $hydrate($value);
224 223
         }
225 224
     }
@@ -324,11 +323,9 @@  discard block
 block discarded – undo
324 323
         return array_map($dehydrate = function($each) use (&$dehydrate) {
325 324
             if ($each instanceof AbstractEntity and $each->hasGid()) {
326 325
                 return $each->getGid();
327
-            }
328
-            elseif ($each instanceof self) {
326
+            } elseif ($each instanceof self) {
329 327
                 return $each->toArray();
330
-            }
331
-            elseif (is_array($each)) {
328
+            } elseif (is_array($each)) {
332 329
                 return array_map($dehydrate, $each);
333 330
             }
334 331
             return $each;
Please login to merge, or discard this patch.