cloudflare/Cloudflare-WordPress
Publicmirrored fromhttps://github.com/cloudflare/Cloudflare-WordPress
src/API/Request.php
107lines · modecode
10 years ago
| 1 | <?php |
| 2 | |
| 3 | namespace CF\API; |
| 4 | |
| 5 | class Request |
| 6 | { |
| 7 | |
| 8 | private $method; |
| 9 | private $url; |
| 10 | private $parameters; |
| 11 | private $body; |
| 12 | private $headers; |
| 13 | |
| 14 | /** |
| 15 | * @param $method |
| 16 | * @param $url |
| 17 | * @param $parameters |
| 18 | * @param $body |
| 19 | */ |
| 20 | public function __construct($method, $url, $parameters, $body) |
| 21 | { |
| 22 | $this->method = strtoupper($method); |
| 23 | $this->url = $url; |
| 24 | $this->parameters = $parameters; |
| 25 | $this->body = $body; |
| 26 | } |
| 27 | |
| 28 | /** |
| 29 | * @return mixed |
| 30 | */ |
| 31 | public function getMethod() |
| 32 | { |
| 33 | return $this->method; |
| 34 | } |
| 35 | |
| 36 | /** |
| 37 | * @param mixed $method |
| 38 | */ |
| 39 | public function setMethod($method) |
| 40 | { |
| 41 | $this->method = strtoupper($method); |
| 42 | } |
| 43 | |
| 44 | /** |
| 45 | * @return mixed |
| 46 | */ |
| 47 | public function getUrl() |
| 48 | { |
| 49 | return $this->url; |
| 50 | } |
| 51 | |
| 52 | /** |
| 53 | * @param mixed $url |
| 54 | */ |
| 55 | public function setUrl($url) |
| 56 | { |
| 57 | $this->url = $url; |
| 58 | } |
| 59 | |
| 60 | /** |
| 61 | * @return mixed |
| 62 | */ |
| 63 | public function getParameters() |
| 64 | { |
| 65 | return $this->parameters; |
| 66 | } |
| 67 | |
| 68 | /** |
| 69 | * @param mixed $parameters |
| 70 | */ |
| 71 | public function setParameters($parameters) |
| 72 | { |
| 73 | $this->parameters = $parameters; |
| 74 | } |
| 75 | |
| 76 | /** |
| 77 | * @return mixed |
| 78 | */ |
| 79 | public function getBody() |
| 80 | { |
| 81 | return $this->body; |
| 82 | } |
| 83 | |
| 84 | /** |
| 85 | * @param mixed $body |
| 86 | */ |
| 87 | public function setBody($body) |
| 88 | { |
| 89 | $this->body = $body; |
| 90 | } |
| 91 | |
| 92 | /** |
| 93 | * @return mixed |
| 94 | */ |
| 95 | public function getHeaders() |
| 96 | { |
| 97 | return $this->headers; |
| 98 | } |
| 99 | |
| 100 | /** |
| 101 | * @param mixed $headers |
| 102 | */ |
| 103 | public function setHeaders($headers) |
| 104 | { |
| 105 | $this->headers = $headers; |
| 106 | } |
| 107 | } |