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 ( f9a184...b81ec7 )
by Andreas
04:10
created

ExportCustomerService::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 2
dl 0
loc 6
rs 10
c 0
b 0
f 0
1
<?php
2
declare(strict_types=1);
3
/**
4
 */
5
6
namespace CommerceLeague\ActiveCampaign\Service;
7
8
use CommerceLeague\ActiveCampaign\Gateway\Request\CustomerBuilder as CustomerRequestBuilder;
9
use CommerceLeague\ActiveCampaign\MessageQueue\Topics;
10
use Magento\Customer\Model\Customer as MagentoCustomer;
11
use Magento\Framework\MessageQueue\PublisherInterface;
12
13
/**
14
 * Class ExportCustomerService
15
 */
16
class ExportCustomerService
17
{
18
19
    /**
20
     * @var CustomerRequestBuilder
21
     */
22
    private $customerRequestBuilder;
23
24
    /**
25
     * @var PublisherInterface
26
     */
27
    private $publisher;
28
29
    /**
30
     * @param CustomerRequestBuilder $customerRequestBuilder
31
     * @param PublisherInterface $publisher
32
     */
33
    public function __construct(
34
        CustomerRequestBuilder $customerRequestBuilder,
35
        PublisherInterface $publisher
36
    ) {
37
        $this->customerRequestBuilder = $customerRequestBuilder;
38
        $this->publisher = $publisher;
39
    }
40
41
    /**
42
     * @param MagentoCustomer $magentoCustomer
43
     */
44
    public function export(MagentoCustomer $magentoCustomer): void
45
    {
46
        $data = [
47
            'magento_customer_id' => $magentoCustomer->getId(),
48
            'request' => $this->customerRequestBuilder->build($magentoCustomer)
49
        ];
50
51
        $this->publisher->publish(Topics::CUSTOMER_EXPORT, json_encode($data));
0 ignored issues
show
Bug introduced by
json_encode($data) of type string is incompatible with the type array|object expected by parameter $data of Magento\Framework\Messag...herInterface::publish(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

51
        $this->publisher->publish(Topics::CUSTOMER_EXPORT, /** @scrutinizer ignore-type */ json_encode($data));
Loading history...
52
    }
53
}
54