MediaWiki 1.42.1
MediaWiki\Json\JsonSerializer Interface Reference

Inherited by MediaWiki\Json\JsonCodec.

Public Member Functions

 serialize ( $value)
 Encode $value as JSON with an intent to use JsonUnserializer::unserialize to decode it back.
 

Detailed Description

Definition at line 33 of file JsonSerializer.php.

Member Function Documentation

◆ serialize()

MediaWiki\Json\JsonSerializer::serialize ( $value)

Encode $value as JSON with an intent to use JsonUnserializer::unserialize to decode it back.

Parameters
mixed | JsonUnserializable$valueA value to encode. Can be any scalar, array, stdClass, JsonUnserializable or any combination of them.
Exceptions
InvalidArgumentExceptionif the value can not be serialized.
Returns
string

Implemented in MediaWiki\Json\JsonCodec.


The documentation for this interface was generated from the following file: