| Total Complexity | 4 |
| Total Lines | 41 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 21 | class IpsGateway extends AbstractGateway |
||
| 22 | { |
||
| 23 | /** |
||
| 24 | * @author EB |
||
| 25 | * @param string $token |
||
| 26 | * @return IpsEntity[] |
||
| 27 | * @throws SdkException |
||
| 28 | */ |
||
| 29 | 1 | public function listIpAddresses($token) |
|
| 30 | { |
||
| 31 | 1 | $response = $this->fetchDocument('/v4/ip-addresses',$token, 'ips'); |
|
| 32 | 1 | $rtn = []; |
|
| 33 | |||
| 34 | 1 | foreach ($response as $ip) { |
|
| 35 | 1 | $rtn[] = IpsEntity::make($ip); |
|
| 36 | 1 | } |
|
| 37 | |||
| 38 | 1 | return $rtn; |
|
| 39 | } |
||
| 40 | |||
| 41 | /** |
||
| 42 | * @author EB |
||
| 43 | * @param string $token |
||
| 44 | * @param $ip |
||
| 45 | * @return array |
||
| 46 | * @throws SdkException |
||
| 47 | */ |
||
| 48 | 1 | public function storeIpAddress($token, $ip) |
|
| 49 | { |
||
| 50 | 1 | return $this->postDocument('/v4/ip-addresses', ['ip' => $ip], $token, 'ips'); |
|
| 51 | } |
||
| 52 | |||
| 53 | /** |
||
| 54 | * @author EB |
||
| 55 | * @param string $token |
||
| 56 | * @param int $id |
||
| 57 | * @return array |
||
| 58 | */ |
||
| 59 | 1 | public function deleteIpAddress($token, $id) |
|
| 62 | } |
||
| 63 | } |
||
| 64 |