29 public function __construct( $msg, $code =
null, ?array $data =
null ) {
31 foreach ( get_class_vars( get_class( $this ) ) as
$key => $value ) {
32 if ( isset( $msg->$key ) ) {
33 $this->
$key = $msg->$key;
36 } elseif ( is_array( $msg ) ) {
37 $key = array_shift( $msg );
38 parent::__construct(
$key, $msg );
40 parent::__construct( $msg );
47 if ( $this->apiCode ===
null ) {
57class_alias( ApiRawMessage::class,
'ApiRawMessage' );
trait ApiMessageTrait
Trait to implement the IApiMessage interface for Message subclasses.