Config   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Test Coverage

Coverage 75%

Importance

Changes 0
Metric Value
eloc 7
c 0
b 0
f 0
dl 0
loc 33
ccs 3
cts 4
cp 0.75
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A is_test_mode() 0 6 2
1
<?php
2
/**
3
 * Mollie config.
4
 *
5
 * @author    Pronamic <[email protected]>
6
 * @copyright 2005-2022 Pronamic
7
 * @license   GPL-3.0-or-later
8
 * @package   Pronamic\WordPress\Pay
9
 */
10
11
namespace Pronamic\WordPress\Pay\Gateways\Mollie;
12
13
use Pronamic\WordPress\Pay\Core\GatewayConfig;
14
15
/**
16
 * Title: Mollie config
17
 * Description:
18
 * Copyright: 2005-2022 Pronamic
19
 * Company: Pronamic
20
 *
21
 * @author  Remco Tolsma
22
 * @version 2.0.9
23
 * @since   1.0.0
24
 */
25
class Config extends GatewayConfig {
26
	/**
27
	 * ID.
28
	 *
29
	 * @var int
30
	 */
31
	public $id;
32
33
	/**
34
	 * API key.
35
	 *
36
	 * @var string|null
37
	 */
38
	public $api_key;
39
40
	/**
41
	 * Bank transfer due date days.
42
	 *
43
	 * @var string|null
44
	 */
45
	public $due_date_days;
46
47
	/**
48
	 * Function to check for test API key.
49
	 *
50
	 * @return bool True if test mode, false otherwise.
51
	 */
52 1
	public function is_test_mode() {
53 1
		if ( null === $this->api_key ) {
54
			return false;
55
		}
56
57 1
		return ( 'test_' === substr( $this->api_key, 0, 5 ) );
58
	}
59
}
60