Laravel version update
Laravel version update
This commit is contained in:
@@ -259,7 +259,8 @@ class Marshaler
|
||||
*/
|
||||
public function unmarshalValue(array $value, $mapAsObject = false)
|
||||
{
|
||||
list($type, $value) = each($value);
|
||||
$type = key($value);
|
||||
$value = $value[$type];
|
||||
switch ($type) {
|
||||
case 'S':
|
||||
case 'BOOL':
|
||||
@@ -269,10 +270,10 @@ class Marshaler
|
||||
case 'N':
|
||||
if ($this->options['wrap_numbers']) {
|
||||
return new NumberValue($value);
|
||||
} else {
|
||||
// Use type coercion to unmarshal numbers to int/float.
|
||||
return $value + 0;
|
||||
}
|
||||
|
||||
// Use type coercion to unmarshal numbers to int/float.
|
||||
return $value + 0;
|
||||
case 'M':
|
||||
if ($mapAsObject) {
|
||||
$data = new \stdClass;
|
||||
@@ -283,8 +284,8 @@ class Marshaler
|
||||
}
|
||||
// NOBREAK: Unmarshal M the same way as L, for arrays.
|
||||
case 'L':
|
||||
foreach ($value as &$v) {
|
||||
$v = $this->unmarshalValue($v, $mapAsObject);
|
||||
foreach ($value as $k => $v) {
|
||||
$value[$k] = $this->unmarshalValue($v, $mapAsObject);
|
||||
}
|
||||
return $value;
|
||||
case 'B':
|
||||
@@ -292,8 +293,8 @@ class Marshaler
|
||||
case 'SS':
|
||||
case 'NS':
|
||||
case 'BS':
|
||||
foreach ($value as &$v) {
|
||||
$v = $this->unmarshalValue([$type[0] => $v]);
|
||||
foreach ($value as $k => $v) {
|
||||
$value[$k] = $this->unmarshalValue([$type[0] => $v]);
|
||||
}
|
||||
return new SetValue($value);
|
||||
}
|
||||
@@ -312,7 +313,9 @@ class Marshaler
|
||||
{
|
||||
if ($this->options['ignore_invalid']) {
|
||||
return null;
|
||||
} elseif ($this->options['nullify_invalid']) {
|
||||
}
|
||||
|
||||
if ($this->options['nullify_invalid']) {
|
||||
return ['NULL' => true];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user