Passed
Push — master ( 984447...7073d8 )
by y
02:06
created
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 (ReflectionException $exception) {
42
+        } catch (ReflectionException $exception) {
44 43
             return 'none'; // unreachable
45 44
         }
46 45
     }
Please login to merge, or discard this patch.
src/CustomField/EnumOption.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -68,8 +68,7 @@  discard block
 block discarded – undo
68 68
                 'enum_option' => $this->getGid(),
69 69
                 'after_enum_option' => $option->getGid()
70 70
             ]);
71
-        }
72
-        else {
71
+        } else {
73 72
             unset($this->data['insert_before'], $this->diff['insert_before']);
74 73
             $this->_set('insert_after', $option->getGid());
75 74
         }
@@ -87,8 +86,7 @@  discard block
 block discarded – undo
87 86
                 'enum_option' => $this->getGid(),
88 87
                 'before_enum_option' => $option->getGid()
89 88
             ]);
90
-        }
91
-        else {
89
+        } else {
92 90
             unset($this->data['insert_after'], $this->diff['insert_after']);
93 91
             $this->_set('insert_before', $option->getGid());
94 92
         }
Please login to merge, or discard this patch.
src/CustomField.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -62,8 +62,7 @@
 block discarded – undo
62 62
         $option->setName($name);
63 63
         if ($this->hasGid()) {
64 64
             $option->create();
65
-        }
66
-        else {
65
+        } else {
67 66
             $this->diff['enum_options'] = true;
68 67
         }
69 68
         $this->data['enum_options'][] = $option;
Please login to merge, or discard this patch.
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/Base/Data.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -291,11 +291,9 @@
 block discarded – undo
291 291
         $dehydrate = function($each) use (&$dehydrate) {
292 292
             if ($each instanceof AbstractEntity and $each->hasGid()) {
293 293
                 return $each->getGid();
294
-            }
295
-            elseif ($each instanceof self) {
294
+            } elseif ($each instanceof self) {
296 295
                 return $each->toArray();
297
-            }
298
-            elseif (is_array($each)) {
296
+            } elseif (is_array($each)) {
299 297
                 return array_map($dehydrate, $each);
300 298
             }
301 299
             return $each;
Please login to merge, or discard this patch.
src/Api/SimpleCache.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -68,8 +68,7 @@
 block discarded – undo
68 68
                     /** @var null|AbstractEntity $entity */
69 69
                     if ($entity = $this->get($entity, $caller, $factory)) {
70 70
                         $this->cache->set($key, $entity->getGid()); // renew potentially nonstandard key
71
-                    }
72
-                    else {
71
+                    } else {
73 72
                         $this->cache->delete($key); // remove invalid key
74 73
                     }
75 74
                     return $entity; // null or hydrated. parent calls add()
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/Base/AbstractEntity.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -68,8 +68,7 @@  discard block
 block discarded – undo
68 68
             $this->data[$key] = array_values(array_unique($this->data[$key]));
69 69
             if ($force) {
70 70
                 $this->diff[$key] = true;
71
-            }
72
-            else {
71
+            } else {
73 72
                 $this->api->getCache()->add($this);
74 73
             }
75 74
         }
@@ -117,8 +116,7 @@  discard block
 block discarded – undo
117 116
         if (isset($key)) {
118 117
             $value = $this->api->get($this, [], ['fields' => static::$optFields[$key] ?? $key])[$key] ?? null;
119 118
             $this->_setMapped($key, $value);
120
-        }
121
-        else {
119
+        } else {
122 120
             $this->_setData($this->api->get($this, [], ['expand' => 'this']));
123 121
         }
124 122
         $this->api->getCache()->add($this);
Please login to merge, or discard this patch.
src/Portfolio.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -73,8 +73,7 @@
 block discarded – undo
73 73
         if ($this->hasGid()) {
74 74
             $this->api->post("{$this}/addMembers", ['members' => array_column($users, 'gid')]);
75 75
             $this->_merge('members', $users);
76
-        }
77
-        else {
76
+        } else {
78 77
             $this->_merge('members', $users, true);
79 78
         }
80 79
         return $this;
Please login to merge, or discard this patch.