@@ -4,25 +4,25 @@ discard block |
||
4 | 4 | { |
5 | 5 | public $lastPostId; |
6 | 6 | |
7 | - /** |
|
8 | - * @var Location |
|
9 | - */ |
|
10 | - public $location; |
|
11 | - public $url; |
|
7 | + /** |
|
8 | + * @var Location |
|
9 | + */ |
|
10 | + public $location; |
|
11 | + public $url; |
|
12 | 12 | |
13 | 13 | |
14 | - function setUrl ($url) |
|
15 | - { |
|
16 | - $this->url = $url; |
|
17 | - } |
|
14 | + function setUrl ($url) |
|
15 | + { |
|
16 | + $this->url = $url; |
|
17 | + } |
|
18 | 18 | |
19 | - function getUrl () |
|
20 | - { |
|
21 | - return $this->url; |
|
22 | - } |
|
19 | + function getUrl () |
|
20 | + { |
|
21 | + return $this->url; |
|
22 | + } |
|
23 | 23 | |
24 | - function setLastPostId ($lastPostId) |
|
25 | - { |
|
24 | + function setLastPostId ($lastPostId) |
|
25 | + { |
|
26 | 26 | $this->lastPostId = $lastPostId; |
27 | 27 | } |
28 | 28 | |
@@ -31,38 +31,38 @@ discard block |
||
31 | 31 | return $this->lastPostId; |
32 | 32 | } |
33 | 33 | |
34 | - function getApiEndPoint() |
|
35 | - { |
|
36 | - $apiEndPoint = $this->getUrl(); |
|
34 | + function getApiEndPoint() |
|
35 | + { |
|
36 | + $apiEndPoint = $this->getUrl(); |
|
37 | 37 | |
38 | - if ($this->getLastPostId() != "") { |
|
38 | + if ($this->getLastPostId() != "") { |
|
39 | 39 | $apiEndPoint = $this->getUrl() . '?after=' . $this->getLastPostId(); |
40 | 40 | } |
41 | - return $apiEndPoint; |
|
42 | - } |
|
43 | - function getPayload() |
|
44 | - { |
|
45 | - if($this->version == 'v3') |
|
46 | - { |
|
47 | - $this->location = new Location(); |
|
48 | - $this->location->setLat(52.520006); |
|
49 | - $this->location->setLng(13.404954); |
|
50 | - $this->location->setCityName('Berlin'); |
|
41 | + return $apiEndPoint; |
|
42 | + } |
|
43 | + function getPayload() |
|
44 | + { |
|
45 | + if($this->version == 'v3') |
|
46 | + { |
|
47 | + $this->location = new Location(); |
|
48 | + $this->location->setLat(52.520006); |
|
49 | + $this->location->setLng(13.404954); |
|
50 | + $this->location->setCityName('Berlin'); |
|
51 | 51 | |
52 | 52 | |
53 | - return array( |
|
54 | - "location" => $this->location->toArray(), |
|
55 | - "stickies" => 'false', |
|
56 | - ); |
|
57 | - } |
|
58 | - else |
|
59 | - { |
|
60 | - return array( |
|
61 | - ); |
|
62 | - } |
|
63 | - } |
|
64 | - function getMethod() |
|
65 | - { |
|
66 | - return 'GET'; |
|
67 | - } |
|
53 | + return array( |
|
54 | + "location" => $this->location->toArray(), |
|
55 | + "stickies" => 'false', |
|
56 | + ); |
|
57 | + } |
|
58 | + else |
|
59 | + { |
|
60 | + return array( |
|
61 | + ); |
|
62 | + } |
|
63 | + } |
|
64 | + function getMethod() |
|
65 | + { |
|
66 | + return 'GET'; |
|
67 | + } |
|
68 | 68 | } |
@@ -1,20 +1,20 @@ |
||
1 | 1 | <?php |
2 | 2 | class Downvote extends AbstractRequest |
3 | 3 | { |
4 | - public $postId; |
|
4 | + public $postId; |
|
5 | 5 | |
6 | - function getApiEndPoint() |
|
7 | - { |
|
8 | - return '/v2/posts/' . $this->postId . '/downvote'; |
|
9 | - } |
|
10 | - function getPayload() |
|
11 | - { |
|
12 | - return array( |
|
13 | - ); |
|
14 | - } |
|
15 | - function getMethod() |
|
16 | - { |
|
17 | - return 'PUT'; |
|
18 | - } |
|
6 | + function getApiEndPoint() |
|
7 | + { |
|
8 | + return '/v2/posts/' . $this->postId . '/downvote'; |
|
9 | + } |
|
10 | + function getPayload() |
|
11 | + { |
|
12 | + return array( |
|
13 | + ); |
|
14 | + } |
|
15 | + function getMethod() |
|
16 | + { |
|
17 | + return 'PUT'; |
|
18 | + } |
|
19 | 19 | } |
20 | 20 |
@@ -1,21 +1,21 @@ |
||
1 | 1 | <?php |
2 | 2 | class Upvote extends AbstractRequest { |
3 | 3 | |
4 | - public $postId; |
|
4 | + public $postId; |
|
5 | 5 | |
6 | - function getApiEndPoint() |
|
7 | - { |
|
8 | - return '/v2/posts/' . $this->postId . '/upvote'; |
|
9 | - } |
|
10 | - function getPayload() |
|
11 | - { |
|
12 | - return array( |
|
6 | + function getApiEndPoint() |
|
7 | + { |
|
8 | + return '/v2/posts/' . $this->postId . '/upvote'; |
|
9 | + } |
|
10 | + function getPayload() |
|
11 | + { |
|
12 | + return array( |
|
13 | 13 | "reason_code" => -1, |
14 | - ); |
|
15 | - } |
|
16 | - function getMethod() |
|
17 | - { |
|
18 | - return 'PUT'; |
|
19 | - } |
|
14 | + ); |
|
15 | + } |
|
16 | + function getMethod() |
|
17 | + { |
|
18 | + return 'PUT'; |
|
19 | + } |
|
20 | 20 | } |
21 | 21 |