Completed
Push — master ( fb0370...84a128 )
by Ronaldo
03:03
created

AddressTransformer::transform()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 13
ccs 0
cts 10
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 10
nc 1
nop 1
crap 2
1
<?php
2
3
namespace WSW\SiftScience\Transformers;
4
5
use WSW\SiftScience\Entities\Address;
6
7
/**
8
 * Class AddressTransformer
9
 *
10
 * @package WSW\SiftScience\Transformers
11
 * @author Ronaldo Matos Rodrigues <[email protected]>
12
 */
13
class AddressTransformer extends AbstractTransformer
14
{
15
16
    public function transform(Address $address)
17
    {
18
        return array_filter([
19
            '$name' => $address->getName(),
20
            '$phone' => $address->getPhone(),
21
            '$address_1' => $address->getAddress1(),
22
            '$address_2' => $address->getAddress2(),
23
            '$city' => $address->getCity(),
24
            '$region' => $address->getRegion(),
25
            '$country' => $address->getCountry(),
26
            '$zipcode' => $address->getZipcode()
27
        ]);
28
    }
29
}
30