Update TypeInterface to extend JsonSerializable and Serializable

This commit is contained in:
Ben Ramsey
2020-03-04 16:44:05 -06:00
parent 158d34625b
commit a21eb6c3ca
10 changed files with 273 additions and 38 deletions
+22
View File
@@ -73,4 +73,26 @@ final class Decimal implements NumberInterface
{
return $this->toString();
}
public function jsonSerialize(): string
{
return $this->toString();
}
public function serialize(): string
{
return $this->toString();
}
/**
* Constructs the object from a serialized string representation
*
* @param string $serialized The serialized string representation of the object
*
* @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint
*/
public function unserialize($serialized): void
{
$this->__construct($serialized);
}
}