ResponseObject::set_original_object()   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 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-2020 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
/**
14
 * Response object
15
 *
16
 * @author  Remco Tolsma
17
 * @version 1.0.0
18
 * @since   1.0.0
19
 */
20
abstract class ResponseObject {
21
	/**
22
	 * Originale response object.
23
	 *
24
	 * @var object|null
25
	 */
26
	private $original_object;
27
28
	/**
29
	 * Get original object.
30
	 *
31
	 * @return object|null
32
	 */
33
	public function get_original_object() {
34
		return $this->original_object;
35
	}
36
37
	/**
38
	 * Set original object.
39
	 *
40
	 * @param object|null $object Object.
41
	 * @return void
42
	 */
43 17
	public function set_original_object( $object ) {
44 17
		$this->original_object = $object;
45 17
	}
46
47
	/**
48
	 * Get JSON.
49
	 *
50
	 * @return object
51
	 */
52 5
	public function get_json() {
53 5
		if ( null !== $this->original_object ) {
54 4
			return $this->original_object;
55
		}
56
57 1
		return (object) array();
58
	}
59
}
60