Directory::add_country()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 2
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Directory.
4
 *
5
 * @author    Pronamic <[email protected]>
6
 * @copyright 2005-2021 Pronamic
7
 * @license   GPL-3.0-or-later
8
 * @package   Pronamic\WordPress\Pay
9
 */
10
11
namespace Pronamic\WordPress\Pay\Gateways\IDealAdvancedV3;
12
13
use Pronamic\WordPress\DateTime\DateTime;
14
15
/**
16
 * Title: Directory
17
 * Description:
18
 * Copyright: 2005-2021 Pronamic
19
 * Company: Pronamic
20
 *
21
 * @author  Remco Tolsma
22
 * @version 2.0.0
23
 */
24
class Directory {
25
	/**
26
	 * The date the issuer list was modified
27
	 *
28
	 * @var DateTime
29
	 */
30
	private $date;
31
32
	/**
33
	 * The countries in this directory
34
	 *
35
	 * @var array<int, Country>
36
	 */
37
	private $countries;
38
39
	/**
40
	 * Constructs and initializes a directory
41
	 *
42
	 * @return void
43
	 */
44
	public function __construct() {
45
		$this->countries = array();
46
	}
47
48
	/**
49
	 * Set the specified date
50
	 *
51
	 * @param DateTime $date Date.
52
	 * @return void
53
	 */
54
	public function set_date( DateTime $date ) {
55
		$this->date = $date;
56
	}
57
58
	/**
59
	 * Add the specified country to this directory
60
	 *
61
	 * @param Country $country Country.
62
	 * @return void
63
	 */
64
	public function add_country( Country $country ) {
65
		$this->countries[] = $country;
66
	}
67
68
	/**
69
	 * Get the countries within this directory
70
	 *
71
	 * @return array<int, Country>
72
	 */
73
	public function get_countries() {
74
		return $this->countries;
75
	}
76
}
77