Total Complexity | 12 |
Total Lines | 68 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
4 | abstract class BaseRequest |
||
5 | { |
||
6 | protected $headers; |
||
7 | protected $resourcePath; |
||
8 | protected $method; |
||
9 | |||
10 | protected $body; |
||
11 | protected $queryString; |
||
12 | |||
13 | public function __construct($method, $resourcePath) { |
||
14 | $this->method = $method; |
||
15 | $this->resourcePath = $resourcePath; |
||
16 | } |
||
17 | |||
18 | abstract public function generateBody(); |
||
19 | abstract public function generateQueryString(); |
||
20 | |||
21 | public function setBody($body) |
||
22 | { |
||
23 | $this->body = $body; |
||
24 | } |
||
25 | |||
26 | public function getBody() |
||
27 | { |
||
28 | return $this->body; |
||
29 | } |
||
30 | |||
31 | public function setQueryString($queryString) |
||
32 | { |
||
33 | $this->queryString = $queryString; |
||
34 | } |
||
35 | |||
36 | public function getQueryString() |
||
37 | { |
||
38 | return $this->queryString; |
||
39 | } |
||
40 | |||
41 | public function isHeaderSet($header) |
||
42 | { |
||
43 | return isset($this->headers[$header]); |
||
44 | } |
||
45 | |||
46 | public function getHeaders() |
||
47 | { |
||
48 | return $this->headers; |
||
49 | } |
||
50 | |||
51 | public function removeHeader($header) |
||
52 | { |
||
53 | if (isset($this->headers[$header])) |
||
54 | { |
||
55 | unset($this->headers[$header]); |
||
56 | } |
||
57 | } |
||
58 | |||
59 | public function setHeader($header, $value) |
||
60 | { |
||
61 | $this->headers[$header] = $value; |
||
62 | } |
||
63 | |||
64 | public function getResourcePath() |
||
65 | { |
||
66 | return $this->resourcePath; |
||
67 | } |
||
68 | |||
69 | public function getMethod() |
||
70 | { |
||
71 | return $this->method; |
||
72 | } |
||
76 |