GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( a2b3b2...f1cd39 )
by Andreas
03:20
created

CustomerBuilder::build()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 5
nc 1
nop 1
dl 0
loc 7
rs 10
c 1
b 0
f 0
1
<?php
2
declare(strict_types=1);
3
/**
4
 */
5
6
namespace CommerceLeague\ActiveCampaign\Gateway\Request;
7
8
use CommerceLeague\ActiveCampaign\Helper\Config as ConfigHelper;
9
use Magento\Customer\Model\Customer as MagentoCustomer;
10
11
/**
12
 * Class CustomerBuilder
13
 */
14
class CustomerBuilder
15
{
16
    /**
17
     * @var ConfigHelper
18
     */
19
    private $configHelper;
20
21
    /**
22
     * @param ConfigHelper $configHelper
23
     */
24
    public function __construct(ConfigHelper $configHelper)
25
    {
26
        $this->configHelper = $configHelper;
27
    }
28
29
    /**
30
     * @param MagentoCustomer $magentoCustomer
31
     * @return array
32
     */
33
    public function build(MagentoCustomer $magentoCustomer): array
34
    {
35
        return [
36
            'connectionid' => (int)$this->configHelper->getConnectionId(),
37
            'externalid' => (int)$magentoCustomer->getId(),
38
            'email' => $magentoCustomer->getData('email'),
39
            'acceptsMarketing' => 1 // TODO::check how this value could be set
40
        ];
41
    }
42
}
43