3 namespace MediaWiki\Tests\Json
;
5 use MediaWiki\Json\JsonDeserializable
;
6 use MediaWiki\Json\JsonDeserializableTrait
;
7 use MediaWiki\Json\JsonDeserializer
;
10 * Testing class for JsonDeserializer unit tests.
12 class JsonDeserializableSuperClass
implements JsonDeserializable
{
13 use JsonDeserializableTrait
;
16 private $superClassField;
18 public function __construct( $superClassFieldValue ) {
19 $this->superClassField
= $superClassFieldValue;
22 public function getSuperClassField() {
23 return $this->superClassField
;
26 public static function newFromJsonArray( JsonDeserializer
$deserializer, array $json ) {
27 return new self( $json['super_class_field'] );
30 protected function toJsonArray(): array {
32 'super_class_field' => $this->getSuperClassField()