@@ -49,8 +49,7 @@ discard block |
||
| 49 | 49 | public function __construct ($caller, array $data = []) { |
| 50 | 50 | if ($caller instanceof self) { |
| 51 | 51 | $this->api = $caller->api; |
| 52 | - } |
|
| 53 | - else { |
|
| 52 | + } else { |
|
| 54 | 53 | $this->api = $caller; |
| 55 | 54 | } |
| 56 | 55 | $this->_setData($data); |
@@ -242,8 +241,7 @@ discard block |
||
| 242 | 241 | $value = array_map(function($each) use ($class) { |
| 243 | 242 | return $this->_hydrate($class[0], $each); |
| 244 | 243 | }, $value); |
| 245 | - } |
|
| 246 | - elseif (isset($value)) { |
|
| 244 | + } elseif (isset($value)) { |
|
| 247 | 245 | $value = $this->_hydrate($class, $value); |
| 248 | 246 | } |
| 249 | 247 | } |
@@ -92,8 +92,7 @@ |
||
| 92 | 92 | protected function _removeWithPost (string $rmPath, array $data, string $field, $diff) { |
| 93 | 93 | if ($this->hasGid()) { |
| 94 | 94 | return $this->_setWithPost($rmPath, $data, $field); |
| 95 | - } |
|
| 96 | - elseif (is_array($diff)) { |
|
| 95 | + } elseif (is_array($diff)) { |
|
| 97 | 96 | return $this->_set($field, array_values(array_diff($this->data[$field] ?? [], $diff))); |
| 98 | 97 | } |
| 99 | 98 | return $this->_set($field, array_values(array_filter($this->data[$field] ?? [], $diff))); |