Data   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Test Coverage

Coverage 61.53%

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 51
ccs 8
cts 13
cp 0.6153
rs 10
c 0
b 0
f 0
wmc 5

4 Methods

Rating   Name   Duplication   Size   Complexity  
A set_field() 0 4 1
A get_fields() 0 2 1
A get_field() 0 8 2
A __construct() 0 2 1
1
<?php
2
3
namespace Pronamic\WordPress\Pay\Gateways\Ingenico;
4
5
/**
6
 * Title: Ingenico data
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 Data {
16
	/**
17
	 * Fields
18
	 *
19
	 * @var array
20
	 */
21
	private $fields;
22
23
	/**
24
	 * Constructs and initialize a iDEAL kassa object
25
	 */
26 6
	public function __construct() {
27 6
		$this->fields = array();
28 6
	}
29
30
	/**
31
	 * Get all the fields
32
	 *
33
	 * @return array
34
	 */
35 5
	public function get_fields() {
36 5
		return $this->fields;
37
	}
38
39
	/**
40
	 * Get field by the specifiek name
41
	 *
42
	 * @param string $name
43
	 */
44
	public function get_field( $name ) {
45
		$value = null;
46
47
		if ( isset( $this->fields[ $name ] ) ) {
48
			$value = $this->fields[ $name ];
49
		}
50
51
		return $value;
52
	}
53
54
	/**
55
	 * Set field
56
	 *
57
	 * @param string $name
58
	 * @param string $value
59
	 *
60
	 * @return Data
61
	 */
62 6
	public function set_field( $name, $value ) {
63 6
		$this->fields[ $name ] = $value;
64
65 6
		return $this;
66
	}
67
}
68