Completed
Push — master ( 83a557...8e0143 )
by Remco
11:52 queued 05:23
created

ResponseObject::set_original_object()   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 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 2
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
/**
3
 * Response
4
 *
5
 * @author    Pronamic <[email protected]>
6
 * @copyright 2005-2019 Pronamic
7
 * @license   GPL-3.0-or-later
8
 * @package   Pronamic\WordPress\Pay\Gateways\Adyen
9
 */
10
11
namespace Pronamic\WordPress\Pay\Gateways\Adyen;
12
13
use Pronamic\WordPress\Pay\Core\Statuses as Core_Statuses;
14
15
/**
16
 * Response object
17
 *
18
 * @author  Remco Tolsma
19
 * @version 1.0.0
20
 * @since   1.0.0
21
 */
22
abstract class ResponseObject {
23
	/**
24
	 * Originale response object.
25
	 *
26
	 * @var object|null
27
	 */
28
	private $original_object;
29
30
	/**
31
	 * Get original object.
32
	 *
33
	 * @return object|null
34
	 */
35
	public function get_original_object() {
36
		return $this->original_object;
37
	}
38
39
	/**
40
	 * Set original object.
41
	 *
42
	 * @param object|null $object Object.
43
	 * @return void
44
	 */
45 12
	public function set_original_object( $object ) {
46 12
		$this->original_object = $object;
47 12
	}
48
49
	/**
50
	 * Get JSON.
51
	 *
52
	 * @return object
53
	 */
54 2
	public function get_json() {
55 2
		if ( null !== $this->original_object ) {
56 1
			return $this->original_object;
57
		}
58
59 1
		return (object) array();
60
	}
61
}
62