mirror of
https://gh.wpcy.net/https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2026-04-27 01:22:18 +08:00
42 lines
783 B
PHP
42 lines
783 B
PHP
<?php
|
|
/**
|
|
* Stub for WP_REST_Response
|
|
*/
|
|
|
|
class WP_REST_Response {
|
|
protected $data;
|
|
protected $status;
|
|
protected $headers = array();
|
|
|
|
public function __construct( $data = null, $status = 200, $headers = array() ) {
|
|
$this->data = $data;
|
|
$this->status = $status;
|
|
$this->headers = $headers;
|
|
}
|
|
|
|
public function get_data() {
|
|
return $this->data;
|
|
}
|
|
|
|
public function set_data( $data ) {
|
|
$this->data = $data;
|
|
}
|
|
|
|
public function get_status() {
|
|
return $this->status;
|
|
}
|
|
|
|
public function set_status( $status ) {
|
|
$this->status = $status;
|
|
}
|
|
|
|
public function get_headers() {
|
|
return $this->headers;
|
|
}
|
|
|
|
public function header( $key, $value, $replace = true ) {
|
|
if ( $replace || ! isset( $this->headers[ $key ] ) ) {
|
|
$this->headers[ $key ] = $value;
|
|
}
|
|
}
|
|
}
|