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 ( f1cd39...fb8f78 )
by Andreas
03:42
created

SyncCustomerService::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
nc 1
nop 2
dl 0
loc 6
rs 10
c 1
b 0
f 0
1
<?php
2
declare(strict_types=1);
3
/**
4
 */
5
6
namespace CommerceLeague\ActiveCampaign\Service\Customer;
7
8
9
use CommerceLeague\ActiveCampaign\Gateway\Request\CustomerBuilder as CustomerRequestBuilder;
10
use CommerceLeague\ActiveCampaign\MessageQueue\Topics;
11
use Magento\Customer\Model\Customer as MagentoCustomer;
12
use Magento\Framework\MessageQueue\PublisherInterface;
13
14
class SyncCustomerService
15
{
16
17
    /**
18
     * @var CustomerRequestBuilder
19
     */
20
    private $customerRequestBuilder;
21
22
    /**
23
     * @var PublisherInterface
24
     */
25
    private $publisher;
26
27
    /**
28
     * @param CustomerRequestBuilder $customerRequestBuilder
29
     * @param PublisherInterface $publisher
30
     */
31
    public function __construct(
32
        CustomerRequestBuilder $customerRequestBuilder,
33
        PublisherInterface $publisher
34
    ) {
35
        $this->customerRequestBuilder = $customerRequestBuilder;
36
        $this->publisher = $publisher;
37
    }
38
39
    /**
40
     * @param MagentoCustomer $magentoCustomer
41
     */
42
    public function sync(MagentoCustomer $magentoCustomer): void
43
    {
44
        $data = [
45
            'magento_customer_id' => $magentoCustomer->getId(),
46
            'request' => $this->customerRequestBuilder->build($magentoCustomer)
47
        ];
48
49
        $this->publisher->publish(Topics::CUSTOMER_SYNC, 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

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