@@ -77,7 +77,9 @@ discard block |
||
77 | 77 | { |
78 | 78 | $err = null; |
79 | 79 | |
80 | - if (empty($index)) return $item; |
|
80 | + if (empty($index)) { |
|
81 | + return $item; |
|
82 | + } |
|
81 | 83 | |
82 | 84 | $key = array_shift($index); |
83 | 85 | |
@@ -229,13 +231,21 @@ discard block |
||
229 | 231 | $key = array_shift($index); |
230 | 232 | |
231 | 233 | if (empty($index)) { |
232 | - if (is_object($item) && isset($item->$key)) unset($item->$key); |
|
233 | - if (is_array($item) && isset($item[$key])) unset($item[$key]); |
|
234 | + if (is_object($item) && isset($item->$key)) { |
|
235 | + unset($item->$key); |
|
236 | + } |
|
237 | + if (is_array($item) && isset($item[$key])) { |
|
238 | + unset($item[$key]); |
|
239 | + } |
|
234 | 240 | return; |
235 | 241 | } |
236 | 242 | |
237 | - if (is_object($item) && isset($item->$key)) return static::removeValue($item->$key, $index, $err); |
|
238 | - if (is_array($item) && isset($item[$key])) return static::removeValue($item[$key], $index, $err); |
|
243 | + if (is_object($item) && isset($item->$key)) { |
|
244 | + return static::removeValue($item->$key, $index, $err); |
|
245 | + } |
|
246 | + if (is_array($item) && isset($item[$key])) { |
|
247 | + return static::removeValue($item[$key], $index, $err); |
|
248 | + } |
|
239 | 249 | } |
240 | 250 | |
241 | 251 |