MediaWiki REL1_37
MediaWiki\Json Namespace Reference

Classes

class  JsonCodec
 
interface  JsonConstants
 
interface  JsonSerializer
 
interface  JsonUnserializable
 
interface  JsonUnserializer
 

Variables

trait JsonUnserializableTrait
 

Variable Documentation

◆ JsonUnserializableTrait

trait MediaWiki::Json\JsonUnserializableTrait
Initial value:
{
public function jsonSerialize() {
return $this->annotateJsonForDeserialization(
$this->toJsonArray()
);
}
private function annotateJsonForDeserialization( array $json ): array {
$json[JsonConstants::TYPE_ANNOTATION] = get_class( $this );
return $json;
}
abstract protected function toJsonArray(): array

Definition at line 24 of file JsonUnserializableTrait.php.