RequestHeader::__construct()   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
rs 10
ccs 2
cts 2
cp 1
crap 1
1
<?php
2
/**
3
 * Request Header
4
 *
5
 * @author    Pronamic <[email protected]>
6
 * @copyright 2005-2022 Pronamic
7
 * @license   GPL-3.0-or-later
8
 * @package   Pronamic\WordPress\Pay\Gateways\Payvision
9
 */
10
11
namespace Pronamic\WordPress\Pay\Gateways\Payvision;
12
13
/**
14
 * Request Header
15
 *
16
 * @author  Remco Tolsma
17
 * @version 1.1.0
18
 * @since   1.0.0
19
 */
20
class RequestHeader implements \JsonSerializable {
21
	/**
22
	 * Business ID.
23
	 *
24
	 * @var string
25
	 */
26
	private $business_id;
27
28
	/**
29
	 * Construct and initialize request header.
30
	 *
31
	 * @param string $business_id Business ID.
32
	 */
33 3
	public function __construct( $business_id ) {
34 3
		$this->business_id = $business_id;
35 3
	}
36
37
	/**
38
	 * JSON serialize.
39
	 *
40
	 * @return object
41
	 */
42 2
	public function jsonSerialize() {
43
		return (object) array(
44 2
			'businessId' => $this->business_id,
45
		);
46
	}
47
}
48