| Total Complexity | 5 |
| Total Lines | 55 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | class IPStackAPI implements ContainerInjectableInterface |
||
| 9 | { |
||
| 10 | use ContainerInjectableTrait; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * @var string $ip IP address to locate. |
||
| 14 | */ |
||
| 15 | private $ipadd; |
||
| 16 | |||
| 17 | |||
| 18 | /** |
||
| 19 | * Constructor |
||
| 20 | */ |
||
| 21 | 6 | public function __construct($ipadd) |
|
| 22 | { |
||
| 23 | 6 | $this->ipadd = $ipadd; |
|
| 24 | 6 | } |
|
| 25 | |||
| 26 | |||
| 27 | /** |
||
| 28 | * Make API request with instance variable 'ipadd' and access key. |
||
| 29 | */ |
||
| 30 | 3 | public function request() |
|
| 49 | } |
||
| 50 | |||
| 51 | |||
| 52 | /** |
||
| 53 | * Validate IP |
||
| 54 | * |
||
| 55 | * @return boolean true if valid IP, false otherwise |
||
| 56 | */ |
||
| 57 | 6 | public function isValid($ipadd) |
|
| 63 | } |
||
| 64 | } |
||
| 65 |