Failed Conditions
Push — develop ( 7a407a...ca12d6 )
by Remco
02:53
created

PaymentMethod   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 33
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A get_json() 0 2 1
A __construct() 0 2 1
A get_type() 0 2 1
1
<?php
2
/**
3
 * Payment method
4
 *
5
 * @author    Pronamic <[email protected]>
6
 * @copyright 2005-2019 Pronamic
7
 * @license   GPL-3.0-or-later
8
 * @package   Pronamic\WordPress\Pay\Gateways\OmniKassa2
9
 */
10
11
namespace Pronamic\WordPress\Pay\Gateways\Adyen;
12
13
/**
14
 * Payment method
15
 *
16
 * @author  Remco Tolsma
17
 * @version 2.1.0
18
 * @since   2.0.2
19
 */
20
class PaymentMethod {
21
	/**
22
	 * Type.
23
	 *
24
	 * @var string
25
	 */
26
	public $type;
27
28
	/**
29
	 * Construct a payment method.
30
	 *
31
	 * @param string $type Adyen payment method type.
32
	 */
33 1
	public function __construct( $type ) {
34 1
		$this->type = $type;
35 1
	}
36
37
	/**
38
	 * Get type.
39
	 *
40
	 * @return string
41
	 */
42 1
	public function get_type() {
43 1
		return $this->type;
44
	}
45
46
	/**
47
	 * Get JSON.
48
	 *
49
	 * @return object
50
	 */
51 1
	public function get_json() {
52 1
		return (object) (array) $this;
53
	}
54
}
55