| Total Complexity | 5 |
| Total Lines | 57 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 15 | class Customers extends ApiService { |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @param int $id |
||
| 19 | * @return Customer|null |
||
| 20 | * @throws ApiException |
||
| 21 | * @throws OAuthException |
||
| 22 | */ |
||
| 23 | public function fetch(int $id): ?Customer |
||
| 24 | { |
||
| 25 | /** @var Customer|null $fetch */ |
||
| 26 | $fetch = $this->_get('api/customers/customer' . $id); |
||
| 27 | return $fetch; |
||
| 28 | } |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @param array $data |
||
| 32 | * @return Customer|null |
||
| 33 | * @throws ApiException |
||
| 34 | * @throws OAuthException |
||
| 35 | */ |
||
| 36 | public function create(array $data): ?Customer |
||
| 37 | { |
||
| 38 | /** @var Customer|null $create */ |
||
| 39 | $create = $this->_post('api/customers/customer', $data); |
||
| 40 | return $create; |
||
| 41 | } |
||
| 42 | |||
| 43 | /** |
||
| 44 | * @param int $id |
||
| 45 | * @param array $data |
||
| 46 | * @return Customer|null |
||
| 47 | * @throws ApiException |
||
| 48 | * @throws OAuthException |
||
| 49 | */ |
||
| 50 | public function update(int $id, array $data): ?Customer |
||
| 55 | } |
||
| 56 | |||
| 57 | /** |
||
| 58 | * @param int $id |
||
| 59 | * @return bool |
||
| 60 | */ |
||
| 61 | public function delete(int $id): bool |
||
| 64 | } |
||
| 65 | |||
| 66 | /** |
||
| 67 | * @param string $search |
||
| 68 | * @return ListResource |
||
| 69 | */ |
||
| 70 | public function all(string $search = ''): ListResource { |
||
| 72 | } |
||
| 73 | } |
||
| 74 |