Error::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 3
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
crap 1
1
<?php
2
/**
3
 * Error
4
 *
5
 * @author    Pronamic <[email protected]>
6
 * @copyright 2005-2022 Pronamic
7
 * @license   GPL-3.0-or-later
8
 * @package   Pronamic\WordPress\Pay\Payments
9
 */
10
11
namespace Pronamic\WordPress\Pay\Gateways\Sisow;
12
13
/**
14
 * Title: Sisow error
15
 * Description:
16
 * Copyright: 2005-2022 Pronamic
17
 * Company: Pronamic
18
 *
19
 * @author  Remco Tolsma
20
 * @version 2.0.0
21
 * @since   1.0.0
22
 */
23
class Error {
24
	/**
25
	 * Sisow error code.
26
	 *
27
	 * @var string
28
	 */
29
	public $code;
30
31
	/**
32
	 * Sisow error message.
33
	 *
34
	 * @var string
35
	 */
36
	public $message;
37
38
	/**
39
	 * Constructs and initializes an Sisow error object.
40
	 *
41
	 * @param string $code    Code.
42
	 * @param string $message Message.
43
	 */
44 1
	public function __construct( $code, $message ) {
45 1
		$this->code    = $code;
46 1
		$this->message = $message;
47 1
	}
48
49
	/**
50
	 * Create an string representation of this object.
51
	 *
52
	 * @return string
53
	 */
54 1
	public function __toString() {
55 1
		return $this->code . ' ' . $this->message;
56
	}
57
}
58