| 1 | <?php |
||
| 5 | class JSONRequest extends Request |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * @return array |
||
| 9 | */ |
||
| 10 | public static function getAllowedMethods() |
||
| 11 | { |
||
| 12 | return [ |
||
| 13 | 'getSource', |
||
| 14 | 'send' |
||
| 15 | ]; |
||
| 16 | } |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @param string $source |
||
| 20 | * @return array|null |
||
| 21 | */ |
||
| 22 | public function getSource($source) |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @param string|array $to |
||
| 29 | * @param string $from |
||
| 30 | * @param string $message |
||
| 31 | * @param array $params |
||
| 32 | * @return array|null |
||
| 33 | */ |
||
| 34 | public function send($to, $from, $message, $params = [ ]) |
||
| 49 | |||
| 50 | |||
| 51 | /** |
||
| 52 | * @param string $action |
||
| 53 | * @return string |
||
| 54 | */ |
||
| 55 | public function makeEndPoint($action) |
||
| 59 | |||
| 60 | /** |
||
| 61 | * @param array $requestBody |
||
| 62 | * @return mixed |
||
| 63 | */ |
||
| 64 | protected function formatRequestBody(array $requestBody) |
||
| 68 | |||
| 69 | /** |
||
| 70 | * @param string $response |
||
| 71 | * @return array |
||
| 72 | */ |
||
| 73 | protected function parseResponse($response) |
||
| 77 | } |