Util::get_param_var()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 16
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 8
nc 1
nop 1
dl 0
loc 16
ccs 0
cts 9
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Pronamic\WordPress\Pay\Gateways\Ingenico;
4
5
/**
6
 * Title: Ingenico utility
7
 * Description:
8
 * Copyright: 2005-2021 Pronamic
9
 * Company: Pronamic
10
 *
11
 * @author  Remco Tolsma
12
 * @version 2.0.0
13
 * @since   1.0.0
14
 */
15
class Util {
16
	/**
17
	 * Get parameter variable
18
	 *
19
	 * @param string $param_var
20
	 */
21
	public static function get_param_var( $param_var ) {
22
		// Find and replace
23
		// @link https://github.com/woothemes/woocommerce/blob/v2.0.19/classes/emails/class-wc-email-new-order.php
24
		$find    = array();
25
		$replace = array();
26
27
		$find[]    = '{site_url}';
28
		$replace[] = site_url();
29
30
		$find[]    = '{home_url}';
31
		$replace[] = home_url();
32
33
		// Parameter Variable
34
		$param_var = str_replace( $find, $replace, $param_var );
35
36
		return $param_var;
37
	}
38
}
39