| Total Complexity | 5 |
| Total Lines | 57 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 15 | class Addresses extends ApiService { |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @param int $id |
||
| 19 | * @return Address|null |
||
| 20 | * @throws ApiException |
||
| 21 | * @throws OAuthException |
||
| 22 | */ |
||
| 23 | public function fetch(int $id): ?Address |
||
| 24 | { |
||
| 25 | /** @var Address|null $address */ |
||
| 26 | $address = $this->_get('api/addresses/address' . $id); |
||
| 27 | return $address; |
||
| 28 | } |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @param array $data |
||
| 32 | * @return Address|null |
||
| 33 | * @throws ApiException |
||
| 34 | * @throws OAuthException |
||
| 35 | */ |
||
| 36 | public function create(array $data): ?Address |
||
| 37 | { |
||
| 38 | /** @var Address|null $address */ |
||
| 39 | $address = $this->_post('api/addresses/address', $data); |
||
| 40 | return $address; |
||
| 41 | } |
||
| 42 | |||
| 43 | /** |
||
| 44 | * @param int $id |
||
| 45 | * @param array $data |
||
| 46 | * @return Address|null |
||
| 47 | * @throws ApiException |
||
| 48 | * @throws OAuthException |
||
| 49 | */ |
||
| 50 | public function update(int $id, array $data): ?Address |
||
| 51 | { |
||
| 52 | /** @var Address|null $address */ |
||
| 53 | $address = $this->_post('api/addresses/address/' . $id, $data); |
||
| 54 | return $address; |
||
| 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 |