Total Complexity | 5 |
Total Lines | 57 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | class Subscriptions extends CafeApi |
||
11 | { |
||
12 | /** |
||
13 | * Subscriptions constructor |
||
14 | * @param string $api_url |
||
15 | * @param string $email |
||
16 | * @param string $password |
||
17 | */ |
||
18 | public function __construct(string $api_url, string $email, string $password) |
||
19 | { |
||
20 | parent::__construct($api_url, $email, $password); |
||
21 | } |
||
22 | |||
23 | /** |
||
24 | * Index |
||
25 | * @return Subscriptions |
||
26 | */ |
||
27 | public function index(): Subscriptions |
||
28 | { |
||
29 | $this->request('GET', '/subscription'); |
||
30 | |||
31 | return $this; |
||
32 | } |
||
33 | |||
34 | /** |
||
35 | * Create |
||
36 | * @param array $fields |
||
37 | * @return Subscriptions |
||
38 | */ |
||
39 | public function create(array $fields): Subscriptions |
||
40 | { |
||
41 | $this->request('POST', '/subscription', $fields); |
||
42 | |||
43 | return $this; |
||
44 | } |
||
45 | |||
46 | /** |
||
47 | * Read |
||
48 | * @return Subscriptions |
||
49 | */ |
||
50 | public function read(): Subscriptions |
||
51 | { |
||
52 | $this->request('GET', '/subscription/plans'); |
||
53 | |||
54 | return $this; |
||
55 | } |
||
56 | |||
57 | /** |
||
58 | * Update |
||
59 | * @param array $fields |
||
60 | * @return Subscriptions |
||
61 | */ |
||
62 | public function update(array $fields): Subscriptions |
||
67 | } |
||
68 | } |
||
69 |