MediaWiki REL1_40
|
Inherited by MediaWiki\Json\JsonCodec.
Public Member Functions | |
unserialize ( $json, string $expectedClass=null) | |
Restore an instance of simple type or JsonUnserializable subclass from the JSON serialization. | |
unserializeArray (array $array) | |
Helper to unserialize an array of JsonUnserializable instances or simple types. | |
Definition at line 33 of file JsonUnserializer.php.
MediaWiki\Json\JsonUnserializer::unserialize | ( | $json, | |
string | $expectedClass = null ) |
Restore an instance of simple type or JsonUnserializable subclass from the JSON serialization.
It supports passing array/object to allow manual decoding of the JSON string if needed.
@phpcs:ignore MediaWiki.Commenting.FunctionComment.ObjectTypeHintParam
array | string | object | $json | |
string | null | $expectedClass | What class to expect in unserialization. If null, no expectation. Must be a descendant of JsonUnserializable. |
InvalidArgumentException | if the passed $json can't be unserialized. |
Implemented in MediaWiki\Json\JsonCodec.
MediaWiki\Json\JsonUnserializer::unserializeArray | ( | array | $array | ) |
Helper to unserialize an array of JsonUnserializable instances or simple types.
array | $array |
Implemented in MediaWiki\Json\JsonCodec.