1 | <?php |
||
11 | class API implements RESTInterface { |
||
12 | |||
13 | protected $url; |
||
14 | protected $payload; |
||
15 | |||
16 | /** |
||
17 | * Create a new GoodTill instance. |
||
18 | * |
||
19 | * @return void |
||
|
|||
20 | */ |
||
21 | public function __construct($user, $url, $id = null) |
||
26 | |||
27 | /** |
||
28 | * Good Till API: Access |
||
29 | * |
||
30 | * @return PendingRequest |
||
31 | */ |
||
32 | public function access(): PendingRequest { |
||
35 | |||
36 | /** |
||
37 | * Good Till API: Get Outlet Model |
||
38 | * |
||
39 | * @return array |
||
40 | */ |
||
41 | public function get(): array { |
||
45 | |||
46 | /** |
||
47 | * Good Till API: Create |
||
48 | * |
||
49 | * @param array $data |
||
50 | * @return array |
||
51 | */ |
||
52 | public function create(array $data = []): array { |
||
55 | |||
56 | /** |
||
57 | * Good Till API: Update |
||
58 | * |
||
59 | * @param array $data |
||
60 | * @return array |
||
61 | */ |
||
62 | public function update(array $data): array { |
||
66 | |||
67 | /** |
||
68 | * Good Till API: Delete |
||
69 | * |
||
70 | * @param array $data |
||
71 | * @return array |
||
72 | */ |
||
73 | public function delete(): array { |
||
76 | } |
||
77 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.