diff options
author | Isabelle Hurbain-Palatin <ihurbainpalatin@wikimedia.org> | 2024-10-28 12:16:17 +0100 |
---|---|---|
committer | Isabelle Hurbain-Palatin <ihurbainpalatin@wikimedia.org> | 2024-10-28 17:27:44 +0100 |
commit | 37decd287ac898aceb22b4ba5a558049ac5690eb (patch) | |
tree | bf15a0858cfcfb554e70efddc4763d61c60ae05d /includes/libs/Message/ListParam.php | |
parent | 5ba9e63c2b38c595c9a876111bdd392c51fb6412 (diff) | |
download | mediawikicore-37decd287ac898aceb22b4ba5a558049ac5690eb.tar.gz mediawikicore-37decd287ac898aceb22b4ba5a558049ac5690eb.zip |
Make MessageValue JsonCodecable instead of JsonDeserializable
Change-Id: I8ed6498acb4657c69b58a24fc3cc45f585a31b7d
Diffstat (limited to 'includes/libs/Message/ListParam.php')
-rw-r--r-- | includes/libs/Message/ListParam.php | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/includes/libs/Message/ListParam.php b/includes/libs/Message/ListParam.php index 3b308915d828..058bc8525938 100644 --- a/includes/libs/Message/ListParam.php +++ b/includes/libs/Message/ListParam.php @@ -3,7 +3,7 @@ namespace Wikimedia\Message; use InvalidArgumentException; -use MediaWiki\Json\JsonDeserializer; +use Wikimedia\JsonCodec\JsonCodecableTrait; /** * Value object representing a message parameter that consists of a list of values. @@ -13,6 +13,8 @@ use MediaWiki\Json\JsonDeserializer; * @newable */ class ListParam extends MessageParam { + use JsonCodecableTrait; + /** @var string */ private $listType; @@ -56,7 +58,7 @@ class ListParam extends MessageParam { return "<{$this->type} listType=\"{$this->listType}\">$contents</{$this->type}>"; } - protected function toJsonArray(): array { + public function toJsonArray(): array { // WARNING: When changing how this class is serialized, follow the instructions // at <https://www.mediawiki.org/wiki/Manual:Parser_cache/Serialization_compatibility>! return [ @@ -65,7 +67,7 @@ class ListParam extends MessageParam { ]; } - public static function newFromJsonArray( JsonDeserializer $deserializer, array $json ) { + public static function newFromJsonArray( array $json ) { // WARNING: When changing how this class is serialized, follow the instructions // at <https://www.mediawiki.org/wiki/Manual:Parser_cache/Serialization_compatibility>! if ( count( $json ) !== 2 || !isset( $json[ParamType::LIST] ) || !isset( $json['type'] ) ) { |