response_data = $data; } } /** * @param bool $with_message include the message in the returned data array. * * @return array */ public function get_response_data( bool $with_message = false ): array { if ( $with_message ) { return array_merge( [ 'message' => $this->getMessage() ], $this->response_data ); } return $this->response_data; } /** * @param array $response_data */ public function set_response_data( array $response_data ) { $this->response_data = $response_data; } }