mmainstreet /
jodel-web
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
| 1 | <?php |
||
| 2 | |||
| 3 | class GetPosts extends AbstractRequest |
||
| 4 | { |
||
| 5 | public $lastPostId; |
||
| 6 | |||
| 7 | /** |
||
| 8 | * @var Location |
||
| 9 | */ |
||
| 10 | public $location; |
||
| 11 | public $url; |
||
| 12 | |||
| 13 | |||
| 14 | function setUrl ($url) |
||
| 15 | { |
||
| 16 | $this->url = $url; |
||
| 17 | } |
||
| 18 | |||
| 19 | function getUrl () |
||
| 20 | { |
||
| 21 | return $this->url; |
||
| 22 | } |
||
| 23 | |||
| 24 | function setLastPostId ($lastPostId) |
||
| 25 | { |
||
| 26 | $this->lastPostId = $lastPostId; |
||
| 27 | } |
||
| 28 | |||
| 29 | function getlastPostId () |
||
| 30 | { |
||
| 31 | return $this->lastPostId; |
||
| 32 | } |
||
| 33 | |||
| 34 | function getApiEndPoint() |
||
| 35 | { |
||
| 36 | $apiEndPoint = $this->getUrl(); |
||
| 37 | |||
| 38 | if ($this->getLastPostId() != "") { |
||
| 39 | $apiEndPoint = $this->getUrl() . '?after=' . $this->getLastPostId(); |
||
| 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'); |
||
| 51 | |||
| 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 | } |
||
| 68 | } |
||
|
0 ignored issues
–
show
|
|||
| 69 |
This check marks files that end in a newline character, i.e. an empy line.