|
MediaWiki master
|
Inherited by MediaWiki\Json\JsonCodec.
Public Member Functions | |
| deserialize ( $json, ?string $expectedClass=null) | |
| Restore an instance of simple type or JsonDeserializable subclass from the JSON serialization. | |
| deserializeArray (array $array) | |
| Helper to deserialize an array of JsonDeserializable instances or simple types. | |
| unserialize ( $json, ?string $expectedClass=null) | |
| Backwards-compatibility alias for deserialize() | |
| unserializeArray (array $array) | |
| Backwards-compatibility alias for deserializeArray() | |
Definition at line 20 of file JsonDeserializer.php.
| MediaWiki\Json\JsonDeserializer::deserialize | ( | $json, | |
| ?string | $expectedClass = null ) |
Restore an instance of simple type or JsonDeserializable subclass from the JSON serialization.
It supports passing array/object to allow manual decoding of the JSON string if needed.
| array | string | object | $json | |
| string | null | $expectedClass | What class to expect in deserialization. If null, no expectation. Must be a descendant of JsonDeserializable. |
| JsonException | if the passed $json can't be deserialized. |
Implemented in MediaWiki\Json\JsonCodec.
| MediaWiki\Json\JsonDeserializer::deserializeArray | ( | array | $array | ) |
Helper to deserialize an array of JsonDeserializable instances or simple types.
| array | $array |
Implemented in MediaWiki\Json\JsonCodec.
| MediaWiki\Json\JsonDeserializer::unserialize | ( | $json, | |
| ?string | $expectedClass = null ) |
Backwards-compatibility alias for deserialize()
Implemented in MediaWiki\Json\JsonCodec.
| MediaWiki\Json\JsonDeserializer::unserializeArray | ( | array | $array | ) |
Backwards-compatibility alias for deserializeArray()
Implemented in MediaWiki\Json\JsonCodec.