Error::__toString()   A
last analyzed

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
namespace Pronamic\WordPress\Pay\Gateways\Ingenico;
4
5
/**
6
 * Title: Ingenico error
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 Error {
16
	/**
17
	 * Error code
18
	 *
19
	 * @var string
20
	 */
21
	private $code;
22
23
	/**
24
	 * Error explanation
25
	 *
26
	 * @var string
27
	 */
28
	private $explanation;
29
30
	/**
31
	 * Construct and initialize an Ogone error
32
	 *
33
	 * @param string $code
34
	 * @param string $explanation
35
	 */
36 1
	public function __construct( $code, $explanation ) {
37 1
		$this->code        = $code;
38 1
		$this->explanation = $explanation;
39 1
	}
40
41
	// @todo getters and setters
42
43
	/**
44
	 * Create an string representation of this object
45
	 *
46
	 * @return string
47
	 */
48 1
	public function __toString() {
49 1
		return $this->code . ' ' . $this->explanation;
50
	}
51
}
52