| Total Complexity | 9 |
| Total Lines | 58 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | class StatementHandler extends APIHandler { |
||
| 10 | |||
| 11 | private $statements = '/statement'; |
||
| 12 | private $api = '/api'; |
||
| 13 | private $v1 = '/v1'; |
||
|
|
|||
| 14 | private $v2 = '/v2'; |
||
| 15 | |||
| 16 | public $statement_forwarding; |
||
| 17 | |||
| 18 | protected $headers = [ |
||
| 19 | 'Content-Type' => 'application/json' |
||
| 20 | ]; |
||
| 21 | |||
| 22 | function __construct($id = null) { |
||
| 23 | parent::__construct(); |
||
| 24 | $this->id = $id; |
||
| 25 | } |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Learning Locker API: Clients |
||
| 29 | * |
||
| 30 | * @return ClientHandler |
||
| 31 | */ |
||
| 32 | public function forwarding($id = null) |
||
| 33 | { |
||
| 34 | if ($this->statement_forwarding) return $this->statement_forwarding; |
||
| 35 | |||
| 36 | $this->statement_forwarding = new StatementForwardingHandler($id ? $id : null); |
||
| 37 | return $this->forwarding($id ? $id : null); |
||
| 38 | } |
||
| 39 | |||
| 40 | /** |
||
| 41 | * Learning Locker: Request Organisation Details |
||
| 42 | * |
||
| 43 | * @return $response |
||
| 44 | */ |
||
| 45 | public function get() { |
||
| 46 | try { |
||
| 47 | $url = $this->url . $this->api . $this->v2 . $this->statements . '/' . $this->id ?? $this->id; |
||
| 48 | $response = $this->request($url); |
||
| 49 | return $response; |
||
| 50 | } catch (Exception $e) { |
||
| 51 | return $e; |
||
| 52 | } |
||
| 53 | } |
||
| 54 | |||
| 55 | /** |
||
| 56 | * Learning Locker: Request Organisation Details |
||
| 57 | * |
||
| 58 | * @return $response |
||
| 59 | */ |
||
| 60 | public function update($data) { |
||
| 67 | } |
||
| 68 | } |
||
| 69 | } |
||
| 70 |