| Total Complexity | 6 | 
| Total Lines | 86 | 
| Duplicated Lines | 0 % | 
| Changes | 0 | ||
| 1 | <?php | ||
| 9 | class Wallets extends CafeApi | ||
| 10 | { | ||
| 11 | /** | ||
| 12 | * Wallets constructor. | ||
| 13 | * @param string $apiUrl | ||
| 14 | * @param string $email | ||
| 15 | * @param string $password | ||
| 16 | */ | ||
| 17 | public function __construct(string $apiUrl, string $email, string $password) | ||
| 18 |     { | ||
| 19 | parent::__construct($apiUrl, $email, $password); | ||
| 20 | } | ||
| 21 | |||
| 22 | /** | ||
| 23 | * @param array|null $headers | ||
| 24 | * @return Wallets | ||
| 25 | */ | ||
| 26 | public function index(?array $headers): Wallets | ||
| 27 |     { | ||
| 28 | $this->request( | ||
| 29 | "GET", | ||
| 30 | "/wallets", | ||
| 31 | null, | ||
| 32 | $headers | ||
| 33 | ); | ||
| 34 | |||
| 35 | return $this; | ||
| 36 | } | ||
| 37 | |||
| 38 | /** | ||
| 39 | * @param array $fields | ||
| 40 | * @return Wallets | ||
| 41 | */ | ||
| 42 | public function create(array $fields): Wallets | ||
| 43 |     { | ||
| 44 | $this->request( | ||
| 45 | "POST", | ||
| 46 | "/wallets", | ||
| 47 | $fields | ||
| 48 | ); | ||
| 49 | |||
| 50 | return $this; | ||
| 51 | } | ||
| 52 | |||
| 53 | /** | ||
| 54 | * @param int $walletId | ||
| 55 | * @return Wallets | ||
| 56 | */ | ||
| 57 | public function read(int $walletId): Wallets | ||
| 58 |     { | ||
| 59 | $this->request( | ||
| 60 | "GET", | ||
| 61 |             "/wallets/{$walletId}" | ||
| 62 | ); | ||
| 63 | |||
| 64 | return $this; | ||
| 65 | } | ||
| 66 | |||
| 67 | /** | ||
| 68 | * @param int $walletId | ||
| 69 | * @param array $fields | ||
| 70 | * @return Wallets | ||
| 71 | */ | ||
| 72 | public function update(int $walletId, array $fields): Wallets | ||
| 73 |     { | ||
| 74 | $this->request( | ||
| 75 | "PUT", | ||
| 76 |             "/wallets/{$walletId}", | ||
| 77 | $fields | ||
| 78 | ); | ||
| 79 | |||
| 80 | return $this; | ||
| 81 | } | ||
| 82 | |||
| 83 | /** | ||
| 84 | * @param int $walletId | ||
| 85 | * @return Wallets | ||
| 86 | */ | ||
| 87 | public function delete(int $walletId): Wallets | ||
| 95 | } | ||
| 96 | } |