43 public function __construct( $msg, $code =
null, ?array $data =
null ) {
45 foreach ( get_class_vars( get_class( $this ) ) as
$key => $value ) {
46 if ( isset( $msg->$key ) ) {
47 $this->
$key = $msg->$key;
50 } elseif ( is_array( $msg ) ) {
51 $key = array_shift( $msg );
52 parent::__construct(
$key, $msg );
54 parent::__construct( $msg );
60 if ( $this->apiCode ===
null ) {
70class_alias( ApiRawMessage::class,
'ApiRawMessage' );
trait ApiMessageTrait
Trait to implement the IApiMessage interface for Message subclasses.