Passed
Branch feature/ECO-573-per-item-proce... (fe5bf4)
by Andrey
04:56
created

ObtainProfileInformationConverter   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 21
rs 10
c 0
b 0
f 0
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A convert() 0 13 3
1
<?php
2
3
/**
4
 * Apache OSL-2
5
 * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
 */
7
8
namespace SprykerEco\Zed\Amazonpay\Business\Api\Converter;
9
10
use Generated\Shared\Transfer\CustomerTransfer;
11
12
class ObtainProfileInformationConverter extends AbstractArrayConverter
13
{
14
15
    /**
16
     * @param array $response
17
     *
18
     * @return \Generated\Shared\Transfer\CustomerTransfer
19
     */
20
    public function convert(array $response)
21
    {
22
        $responseTransfer = new CustomerTransfer();
23
24
        if (!empty($response['name'])) {
25
            $responseTransfer = $this->updateNameData($responseTransfer, $response['name']);
26
        }
27
28
        if (!empty($response['email'])) {
29
            $responseTransfer->setEmail($response['email']);
30
        }
31
32
        return $responseTransfer;
33
    }
34
35
}
36