Completed
Push — master ( 20d8fe...40dd32 )
by Harald
09:20 queued 04:54
created

ip_address::execute()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 4
nc 2
nop 1
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
1
<?php
2
/**
3
  * osCommerce Online Merchant
4
  *
5
  * @copyright (c) 2016 osCommerce; https://www.oscommerce.com
6
  * @license GPL; https://www.oscommerce.com/gpllicense.txt
7
  */
8
9
namespace OSC\OM\Is;
10
11
class ip_address
12
{
13
    public static function execute($ip)
14
    {
15
        $ip = trim($ip);
16
17
        return !empty($ip) && filter_var($ip, FILTER_VALIDATE_IP, [
18
            'flags' => FILTER_FLAG_IPV4
19
        ]);
20
    }
21
}
22