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/Newsletter/ExportContactObserver.php (1 issue)

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

60
            /** @scrutinizer ignore-type */ json_encode(['email' => $subscriber->getEmail()])
Loading history...
61
        );
62
    }
63
}
64