mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-11 06:28:40 +00:00
Fix json serializable
This commit is contained in:
parent
5d1e7429de
commit
9dde2dfa72
|
|
@ -15,8 +15,6 @@
|
||||||
*/
|
*/
|
||||||
namespace phpOMS\Datatypes;
|
namespace phpOMS\Datatypes;
|
||||||
|
|
||||||
use phpOMS\Contract\JsonableInterface;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Address class.
|
* Address class.
|
||||||
*
|
*
|
||||||
|
|
@ -28,7 +26,7 @@ use phpOMS\Contract\JsonableInterface;
|
||||||
* @link http://orange-management.com
|
* @link http://orange-management.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
class Address implements JsonableInterface
|
class Address implements \JsonSerializable
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -161,7 +159,7 @@ class Address implements JsonableInterface
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function toJson(int $option = 0) : string
|
public function jsonSerialize(int $option = 0) : string
|
||||||
{
|
{
|
||||||
return json_encode($this->toArray());
|
return json_encode($this->toArray());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,6 @@
|
||||||
*/
|
*/
|
||||||
namespace phpOMS\Datatypes;
|
namespace phpOMS\Datatypes;
|
||||||
|
|
||||||
use phpOMS\Contract\JsonableInterface;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Location class.
|
* Location class.
|
||||||
*
|
*
|
||||||
|
|
@ -28,7 +26,7 @@ use phpOMS\Contract\JsonableInterface;
|
||||||
* @link http://orange-management.com
|
* @link http://orange-management.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
class Location implements JsonableInterface, \Serializable
|
class Location implements \JsonSerializable, \Serializable
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -251,7 +249,7 @@ class Location implements JsonableInterface, \Serializable
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function toJson(int $option = 0) : string
|
public function jsonSerialize() : string
|
||||||
{
|
{
|
||||||
return json_encode($this->toArray());
|
return json_encode($this->toArray());
|
||||||
}
|
}
|
||||||
|
|
@ -264,7 +262,7 @@ class Location implements JsonableInterface, \Serializable
|
||||||
*/
|
*/
|
||||||
public function serialize()
|
public function serialize()
|
||||||
{
|
{
|
||||||
return $this->toJson();
|
return $this->jsonSerialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ use phpOMS\Utils\ArrayUtils;
|
||||||
* @link http://orange-management.com
|
* @link http://orange-management.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
abstract class ResponseAbstract implements MessageInterface
|
abstract class ResponseAbstract implements MessageInterface, \JsonSerializable
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -150,7 +150,7 @@ abstract class ResponseAbstract implements MessageInterface
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function toJson(int $options = 0) : string
|
public function jsonSerialize(int $options = 0) : string
|
||||||
{
|
{
|
||||||
return json_encode($this->toArray());
|
return json_encode($this->toArray());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user