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.

Issues (203)

Observer/Customer/ExportContactObserver.php (1 issue)

Labels
Severity
1
<?php
2
declare(strict_types=1);
3
/**
4
 */
5
namespace CommerceLeague\ActiveCampaign\Observer\Customer;
6
7
use CommerceLeague\ActiveCampaign\Helper\Config as ConfigHelper;
8
use CommerceLeague\ActiveCampaign\MessageQueue\Topics;
9
use Magento\Customer\Model\Customer as MagentoCustomer;
10
use Magento\Framework\Event\Observer;
11
use Magento\Framework\Event\ObserverInterface;
12
use Magento\Framework\MessageQueue\PublisherInterface;
13
14
/**
15
 * Class ExportContactObserver
16
 */
17
class ExportContactObserver implements ObserverInterface
18
{
19
    /**
20
     * @var ConfigHelper
21
     */
22
    private $configHelper;
23
24
    /**
25
     * @var PublisherInterface
26
     */
27
    private $publisher;
28
29
    /**
30
     * @param ConfigHelper $configHelper
31
     * @param PublisherInterface $publisher
32
     */
33
    public function __construct(
34
        ConfigHelper $configHelper,
35
        PublisherInterface $publisher
36
    ) {
37
        $this->configHelper = $configHelper;
38
        $this->publisher = $publisher;
39
    }
40
41
    /**
42
     * @param Observer $observer
43
     */
44
    public function execute(Observer $observer)
45
    {
46
        if (!$this->configHelper->isEnabled() || !$this->configHelper->isContactExportEnabled()) {
47
            return;
48
        }
49
50
        /** @var MagentoCustomer $magentoCustomer */
51
        $magentoCustomer = $observer->getEvent()->getData('customer');
52
53
        $this->publisher->publish(
54
            Topics::CUSTOMER_CONTACT_EXPORT,
55
            json_encode(['magento_customer_id' => $magentoCustomer->getId()])
0 ignored issues
show
json_encode(array('magen...entoCustomer->getId())) 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

55
            /** @scrutinizer ignore-type */ json_encode(['magento_customer_id' => $magentoCustomer->getId()])
Loading history...
56
        );
57
    }
58
}
59