key = $key; $this->value = $value; } /** @inheritDoc */ public static function jsonClassHintFor( string $keyname ) { // No hints necessary, both $key and $value are arrays return null; } /** @inheritDoc */ public function toJsonArray(): array { return [ $this->key, $this->value ]; } /** @inheritDoc */ public static function newFromJsonArray( array $json ): DataMwAttrib { Assert::invariant( array_is_list( $json ) && count( $json ) === 2, "bad data-mw.attrib" ); return new DataMwAttrib( $json[0], $json[1] ); } }