Localisation updates from https://translatewiki.net.
[mediawiki.git] / tests / phpunit / mocks / json / JsonDeserializableSuperClass.php
blobfa5da6d0ffc0dc41ba52854022135217198281ac
1 <?php
3 namespace MediaWiki\Tests\Json;
5 use MediaWiki\Json\JsonDeserializable;
6 use MediaWiki\Json\JsonDeserializableTrait;
7 use MediaWiki\Json\JsonDeserializer;
9 /**
10 * Testing class for JsonDeserializer unit tests.
12 class JsonDeserializableSuperClass implements JsonDeserializable {
13 use JsonDeserializableTrait;
15 /** @var mixed */
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 {
31 return [
32 'super_class_field' => $this->getSuperClassField()