Failed Conditions
Push — develop ( 06cf49...d16b7e )
by Reüel
05:54
created

Error::get_code()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 2
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Error.
4
 *
5
 * @author    Pronamic <[email protected]>
6
 * @copyright 2005-2020 Pronamic
7
 * @license   GPL-3.0-or-later
8
 * @package   Pronamic\WordPress\Pay
9
 */
10
11
namespace Pronamic\WordPress\Pay\Gateways\IDealAdvancedV3;
12
13
/**
14
 * Title: iDEAL Advanced v3 error
15
 * Description:
16
 * Copyright: 2005-2020 Pronamic
17
 * Company: Pronamic
18
 *
19
 * @author  Remco Tolsma
20
 * @version 2.0.0
21
 */
22
class Error {
23
	/**
24
	 * Code
25
	 *
26
	 * @var string
27
	 */
28
	private $code;
29
30
	/**
31
	 * Message
32
	 *
33
	 * @var string
34
	 */
35
	private $message;
36
37
	/**
38
	 * Detail
39
	 *
40
	 * @var string
41
	 */
42
	private $detail;
43
44
	/**
45
	 * Suggested action
46
	 *
47
	 * @var string
48
	 */
49
	private $suggested_action;
50
51
	/**
52
	 * Consumer message
53
	 *
54
	 * @var string
55
	 */
56
	private $consumer_message;
57
58
	/**
59
	 * Construct and initialize an error.
60
	 */
61 2
	public function __construct() {
62 2
	}
63
64
	/**
65
	 * Get error code.
66
	 *
67
	 * @return string
68
	 */
69 1
	public function get_code() {
70 1
		return $this->code;
71
	}
72
73
	/**
74
	 * Set error code.
75
	 *
76
	 * @param string $code Error code.
77
	 * @return void
78
	 */
79 2
	public function set_code( $code ) {
80 2
		$this->code = $code;
81 2
	}
82
83
	/**
84
	 * Get error message.
85
	 *
86
	 * @return string
87
	 */
88 1
	public function get_message() {
89 1
		return $this->message;
90
	}
91
92
	/**
93
	 * Set error message.
94
	 *
95
	 * @param string $message Error message.
96
	 * @return void
97
	 */
98 2
	public function set_message( $message ) {
99 2
		$this->message = $message;
100 2
	}
101
102
	/**
103
	 * Get error detail.
104
	 *
105
	 * @return string
106
	 */
107 1
	public function get_detail() {
108 1
		return $this->detail;
109
	}
110
111
	/**
112
	 * Set error detail.
113
	 *
114
	 * @param string $detail Detail.
115
	 * @return void
116
	 */
117 1
	public function set_detail( $detail ) {
118 1
		$this->detail = $detail;
119 1
	}
120
121
	/**
122
	 * Get suggested action.
123
	 *
124
	 * @return string
125
	 */
126 1
	public function get_suggested_action() {
127 1
		return $this->suggested_action;
128
	}
129
130
	/**
131
	 * Set suggested action.
132
	 *
133
	 * @param string $suggested_action Suggested action.
134
	 * @return void
135
	 */
136
	public function set_suggested_action( $suggested_action ) {
137
		$this->suggested_action = $suggested_action;
138
	}
139
140
	/**
141
	 * Get consumer message.
142
	 *
143
	 * @return string
144
	 */
145 1
	public function get_consumer_message() {
146 1
		return $this->consumer_message;
147
	}
148
149
	/**
150
	 * Set consumer message.
151
	 *
152
	 * @param string $consumer_message Consumer message.
153
	 * @return void
154
	 */
155 1
	public function set_consumer_message( $consumer_message ) {
156 1
		$this->consumer_message = $consumer_message;
157 1
	}
158
159
	/**
160
	 * Create a string representation of this object.
161
	 *
162
	 * @return string
163
	 */
164 2
	public function __toString() {
165 2
		return $this->code . ' ' . $this->message;
166
	}
167
}
168