MediaWiki  master
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:
{
#[\ReturnTypeWillChange]
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.