WeatherIp   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 9
ccs 4
cts 4
cp 1
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A validateIp() 0 6 2
1
<?php
2
namespace Aisa\Weather;
3
// use Anax\Route\Exception\ForbiddenException;
4
// use Anax\Route\Exception\NotFoundException;
5
// use Anax\Route\Exception\InternalErrorException;
6
use Anax\Commons\ContainerInjectableInterface;
7
use Anax\Commons\ContainerInjectableTrait;
8
9
/**
10
 * Model class witch main responsability is handeling data for /vader
11
 *
12
 * @SuppressWarnings(PHPMD.TooManyPublicMethods)
13
 */
14
 class WeatherIp implements ContainerInjectableInterface
15
 {
16
     use ContainerInjectableTrait;
17 3
     public function validateIp($ipAddress)
18
     {
19 3
         if (filter_var($ipAddress, FILTER_VALIDATE_IP)) {
20 1
             return $ipAddress;
21
         }
22 2
         return null;
23
     }
24
 }
25