Util   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A get_ip_address() 0 8 2
1
<?php
2
3
namespace Pronamic\WordPress\Pay\Gateways\PayNL;
4
5
use Pronamic\WordPress\Pay\Core\Util as Core_Util;
6
7
/**
8
 * Title: Pay.nl utility class
9
 * Description:
10
 * Copyright: 2005-2021 Pronamic
11
 * Company: Pronamic
12
 *
13
 * @author  Remco Tolsma
14
 * @version 2.0.0
15
 * @since   1.0.0
16
 */
17
class Util {
18
	/**
19
	 * Get IP address.
20
	 *
21
	 * @return mixed
22
	 */
23
	public static function get_ip_address() {
24
		$ip_address = Core_Util::get_remote_address();
25
26
		if ( null !== $ip_address ) {
27
			return $ip_address;
28
		}
29
30
		return '127.0.0.1';
31
	}
32
}
33