fix:修复BUG/升级1.1.6版本

This commit is contained in:
Ying
2023-04-25 20:11:49 +08:00
parent 445e5f9662
commit 6a6866bbaf
2357 changed files with 456920 additions and 140567 deletions

View File

@@ -88,6 +88,31 @@ final class EnumMap implements Serializable, IteratorAggregate
$this->values = array_fill(0, count($this->keyUniverse), null);
}
public function __serialize(): array
{
$values = [];
foreach ($this->values as $ordinal => $value) {
if (null === $value) {
continue;
}
$values[$ordinal] = $this->unmaskNull($value);
}
return [
'keyType' => $this->keyType,
'valueType' => $this->valueType,
'allowNullValues' => $this->allowNullValues,
'values' => $values,
];
}
public function __unserialize(array $data): void
{
$this->unserialize(serialize($data));
}
/**
* Checks whether the map types match the supplied ones.
*
@@ -261,22 +286,7 @@ final class EnumMap implements Serializable, IteratorAggregate
public function serialize() : string
{
$values = [];
foreach ($this->values as $ordinal => $value) {
if (null === $value) {
continue;
}
$values[$ordinal] = $this->unmaskNull($value);
}
return serialize([
'keyType' => $this->keyType,
'valueType' => $this->valueType,
'allowNullValues' => $this->allowNullValues,
'values' => $values,
]);
return serialize($this->__serialize());
}
public function unserialize($serialized) : void