@@ -68,8 +68,7 @@ discard block |
||
| 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 |
||
| 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 | } |
@@ -62,8 +62,7 @@ |
||
| 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; |
@@ -460,8 +460,7 @@ |
||
| 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 | } |
@@ -291,11 +291,9 @@ |
||
| 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; |
@@ -41,11 +41,9 @@ |
||
| 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 | } |
@@ -73,8 +73,7 @@ |
||
| 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; |
@@ -39,8 +39,7 @@ |
||
| 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 | } |
@@ -205,8 +205,7 @@ discard block |
||
| 205 | 205 | if ($this->hasGid()) { |
| 206 | 206 | $this->api->post("{$this}/addFollowers", ['followers' => array_column($users, 'gid')]); |
| 207 | 207 | $this->_merge('followers', $users); |
| 208 | - } |
|
| 209 | - else { |
|
| 208 | + } else { |
|
| 210 | 209 | $this->_merge('followers', $users, true); |
| 211 | 210 | } |
| 212 | 211 | return $this; |
@@ -222,8 +221,7 @@ discard block |
||
| 222 | 221 | if ($this->hasGid()) { |
| 223 | 222 | $this->api->post("{$this}/addTag", ['tag' => $tag->getGid()]); |
| 224 | 223 | $this->_merge('tags', [$tag]); |
| 225 | - } |
|
| 226 | - else { |
|
| 224 | + } else { |
|
| 227 | 225 | $this->_merge('tags', [$tag], true); |
| 228 | 226 | } |
| 229 | 227 | return $this; |
@@ -239,8 +237,7 @@ discard block |
||
| 239 | 237 | if ($target instanceof Project) { |
| 240 | 238 | $project = $target; |
| 241 | 239 | $section = null; |
| 242 | - } |
|
| 243 | - else { |
|
| 240 | + } else { |
|
| 244 | 241 | $project = $target->getProject(); |
| 245 | 242 | $section = $target; |
| 246 | 243 | } |
@@ -255,8 +252,7 @@ discard block |
||
| 255 | 252 | 'section' => $section |
| 256 | 253 | ]) |
| 257 | 254 | ]); |
| 258 | - } |
|
| 259 | - else { |
|
| 255 | + } else { |
|
| 260 | 256 | if (!$this->hasWorkspace()) { |
| 261 | 257 | $this->setWorkspace($project->getWorkspace()); |
| 262 | 258 | } |
@@ -567,8 +563,7 @@ discard block |
||
| 567 | 563 | if ($this->hasGid()) { |
| 568 | 564 | $this->api->post("{$this}/setParent", ['parent' => $parent ? $parent->getGid() : null]); |
| 569 | 565 | $this->data['parent'] = $parent; |
| 570 | - } |
|
| 571 | - else { |
|
| 566 | + } else { |
|
| 572 | 567 | $this->_set('parent', $parent); |
| 573 | 568 | } |
| 574 | 569 | return $this; |
@@ -63,8 +63,7 @@ discard block |
||
| 63 | 63 | $this->data[$key] = array_values(array_unique($this->data[$key])); |
| 64 | 64 | if ($force) { |
| 65 | 65 | $this->diff[$key] = true; |
| 66 | - } |
|
| 67 | - else { |
|
| 66 | + } else { |
|
| 68 | 67 | $this->_cache(); |
| 69 | 68 | } |
| 70 | 69 | } |
@@ -105,8 +104,7 @@ discard block |
||
| 105 | 104 | if (isset($key)) { |
| 106 | 105 | $value = $this->api->get($this, [], ['fields' => static::$optFields[$key] ?? $key])[$key] ?? null; |
| 107 | 106 | $this->_setMapped($key, $value); |
| 108 | - } |
|
| 109 | - else { |
|
| 107 | + } else { |
|
| 110 | 108 | $this->_setData($this->api->get($this, [], ['expand' => 'this'])); |
| 111 | 109 | } |
| 112 | 110 | $this->_cache(); |