Mercurial > nebulaweb3
diff default/assets/vendors/theme-widgets/vendor/abraham/twitteroauth/src/Response.php @ 0:1d038bc9b3d2 default tip
Up:default
author | Liny <dev@neowd.com> |
---|---|
date | Sat, 31 May 2025 09:21:51 +0800 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/default/assets/vendors/theme-widgets/vendor/abraham/twitteroauth/src/Response.php Sat May 31 09:21:51 2025 +0800 @@ -0,0 +1,107 @@ +<?php + +namespace Abraham\TwitterOAuth; + +/** + * The result of the most recent API request. + * + * @author Abraham Williams <[email protected]> + */ +class Response +{ + /** @var string|null API path from the most recent request */ + private $apiPath; + /** @var int HTTP status code from the most recent request */ + private $httpCode = 0; + /** @var array HTTP headers from the most recent request */ + private $headers = []; + /** @var array|object Response body from the most recent request */ + private $body = []; + /** @var array HTTP headers from the most recent request that start with X */ + private $xHeaders = []; + + /** + * @param string $apiPath + */ + public function setApiPath($apiPath) + { + $this->apiPath = $apiPath; + } + + /** + * @return string|null + */ + public function getApiPath() + { + return $this->apiPath; + } + + /** + * @param array|object $body + */ + public function setBody($body) + { + $this->body = $body; + } + + /** + * @return array|object|string + */ + public function getBody() + { + return $this->body; + } + + /** + * @param int $httpCode + */ + public function setHttpCode($httpCode) + { + $this->httpCode = $httpCode; + } + + /** + * @return int + */ + public function getHttpCode() + { + return $this->httpCode; + } + + /** + * @param array $headers + */ + public function setHeaders(array $headers) + { + foreach ($headers as $key => $value) { + if (substr($key, 0, 1) == 'x') { + $this->xHeaders[$key] = $value; + } + } + $this->headers = $headers; + } + + /** + * @return array + */ + public function getsHeaders() + { + return $this->headers; + } + + /** + * @param array $xHeaders + */ + public function setXHeaders(array $xHeaders = []) + { + $this->xHeaders = $xHeaders; + } + + /** + * @return array + */ + public function getXHeaders() + { + return $this->xHeaders; + } +}