StartParameters   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 81
Duplicated Lines 0 %

Test Coverage

Coverage 66.67%

Importance

Changes 0
Metric Value
eloc 17
dl 0
loc 81
ccs 8
cts 12
cp 0.6667
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A get_array() 0 9 1
A getIterator() 0 2 1
A __construct() 0 1 1
1
<?php
2
3
namespace Pronamic\WordPress\Pay\Gateways\TargetPay;
4
5
use ArrayIterator;
6
use IteratorAggregate;
7
8
/**
9
 * Title: TargetPay start parameters
10
 * Description:
11
 * Copyright: 2005-2021 Pronamic
12
 * Company: Pronamic
13
 *
14
 * @author  Remco Tolsma
15
 * @version 2.0.0
16
 * @since   1.0.0
17
 */
18
class StartParameters implements IteratorAggregate {
19
	/**
20
	 * Layoutcode
21
	 *
22
	 * @var string
23
	 */
24
	public $rtlo;
25
26
	/**
27
	 * Description
28
	 *
29
	 * @var string
30
	 */
31
	public $description;
32
33
	/**
34
	 * Amount
35
	 *
36
	 * @var string
37
	 */
38
	public $amount;
39
40
	/**
41
	 * Country
42
	 *
43
	 * @var string
44
	 */
45
	public $country;
46
47
	/**
48
	 * Language
49
	 *
50
	 * @var string
51
	 */
52
	public $language;
53
54
	/**
55
	 * Return URL
56
	 *
57
	 * @var string
58
	 */
59
	public $return_url;
60
61
	/**
62
	 * Report URL
63
	 *
64
	 * @var string
65
	 */
66
	public $report_url;
67
68
	/**
69
	 * Constructs and initialize start parameters
70
	 */
71
	public function __construct() {
72
73
	}
74
75
	/**
76
	 * Get array
77
	 *
78
	 * @rerturn array
79
	 */
80 1
	public function get_array() {
81
		return array(
82 1
			'rtlo'        => $this->rtlo,
83 1
			'description' => $this->description,
84 1
			'amount'      => $this->amount,
85 1
			'country'     => $this->country,
86 1
			'lang'        => $this->language,
87 1
			'returnurl'   => $this->return_url,
88 1
			'reporturl'   => $this->report_url,
89
		);
90
	}
91
92
	/**
93
	 * Get iterator
94
	 *
95
	 * @return ArrayIterator
96
	 */
97
	public function getIterator() {
98
		return new ArrayIterator( $this->get_array() );
99
	}
100
}
101