Failed Conditions
Push — develop ( 0b29b3...e9481e )
by Remco
03:53 queued 10s
created

AddressTransformer   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 18
ccs 0
cts 10
cp 0
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A transform() 0 11 1
1
<?php
2
/**
3
 * Address transformer
4
 *
5
 * @author    Pronamic <[email protected]>
6
 * @copyright 2005-2019 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
use Pronamic\WordPress\Pay\Address as Pay_Address;
14
15
/**
16
 * Address transformer
17
 *
18
 * @author  Remco Tolsma
19
 * @version 1.0.0
20
 * @since   1.0.0
21
 */
22
class AddressTransformer {
23
	/**
24
	 * Transform WordPress Pay address to Adyen address.
25
	 *
26
	 * @param Pay_Address $address WordPress Pay address to convert.
27
	 * @return Address
28
	 */
29
	public static function transform( Pay_Address $address ) {
30
		$address = new Address(
31
			$address->get_country_code(),
32
			$address->get_street_name(),
33
			$address->get_house_number(),
34
			$address->get_postal_code(),
35
			$address->get_city(),
36
			$address->get_region()
37
		);
38
39
		return $address;
40
	}
41
}
42