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.
Passed
Push — master ( 47b153...f845d1 )
by Andreas
04:10
created

Config::isContactExportEnabled()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
declare(strict_types=1);
3
/**
4
 */
5
namespace CommerceLeague\ActiveCampaign\Helper;
6
7
use Magento\Framework\App\Helper\AbstractHelper;
8
9
/**
10
 * Class Config
11
 */
12
class Config extends AbstractHelper
13
{
14
    private const XML_PATH_GENERAL_ENABLED = 'activecampaign/general/enabled';
15
    private const XML_PATH_GENERAL_API_URL = 'activecampaign/general/api_url';
16
    private const XML_PATH_GENERAL_API_TOKEN = 'activecampaign/general/api_token';
17
    private const XML_PATH_GENERAL_CONNECTION_ID = 'activecampaign/general/connection_id';
18
19
    private const XML_PATH_EXPORT_CONTACT_ENABLED = 'activecampaign/export/contact_enabled';
20
    private const XML_PATH_EXPORT_CUSTOMER_ENABLED = 'activecampaign/export/customer_enabled';
21
    private const XML_PATH_EXPORT_ORDER_ENABLED = 'activecampaign/export/order_enabled';
22
    private const XML_PATH_EXPORT_ABANDONED_CART_ENABLED = 'activecampaign/export/abandoned_cart_enabled';
23
24
    private const XML_PATH_WEBHOOK_ENABLED = 'activecampaign/webhook/enabled';
25
    private const XML_PATH_WEBHOOK_TOKEN = 'activecampaign/webhook/token';
26
27
    /**
28
     * @return bool
29
     */
30
    public function isEnabled(): bool
31
    {
32
        return (bool)$this->scopeConfig->isSetFlag(self::XML_PATH_GENERAL_ENABLED);
33
    }
34
35
    /**
36
     * @return string|null
37
     */
38
    public function getApiUrl(): ?string
39
    {
40
        return $this->scopeConfig->getValue(self::XML_PATH_GENERAL_API_URL);
41
    }
42
43
    /**
44
     * @return string|null
45
     */
46
    public function getApiToken(): ?string
47
    {
48
        return $this->scopeConfig->getValue(self::XML_PATH_GENERAL_API_TOKEN);
49
    }
50
51
    /**
52
     * @return string|null
53
     */
54
    public function getConnectionId(): ?string
55
    {
56
        return $this->scopeConfig->getValue(self::XML_PATH_GENERAL_CONNECTION_ID);
57
    }
58
59
    /**
60
     * @return bool
61
     */
62
    public function isContactExportEnabled(): bool
63
    {
64
        return (bool)$this->scopeConfig->isSetFlag(self::XML_PATH_EXPORT_CONTACT_ENABLED);
65
    }
66
67
    /**
68
     * @return bool
69
     */
70
    public function isCustomerExportEnabled(): bool
71
    {
72
        return (bool)$this->scopeConfig->isSetFlag(self::XML_PATH_EXPORT_CUSTOMER_ENABLED);
73
    }
74
75
    /**
76
     * @return bool
77
     */
78
    public function isOrderExportEnabled(): bool
79
    {
80
        return (bool)$this->scopeConfig->isSetFlag(self::XML_PATH_EXPORT_ORDER_ENABLED);
81
    }
82
83
    /**
84
     * @return bool
85
     */
86
    public function isAbandonedCartExportEnabled(): bool
87
    {
88
        return (bool)$this->scopeConfig->isSetFlag(self::XML_PATH_EXPORT_ABANDONED_CART_ENABLED);
89
    }
90
91
    /**
92
     * @return bool
93
     */
94
    public function isWebhookEnabled(): bool
95
    {
96
        return (bool)$this->scopeConfig->isSetFlag(self::XML_PATH_WEBHOOK_ENABLED);
97
    }
98
99
    /**
100
     * @return string|null
101
     */
102
    public function getWebhookToken(): ?string
103
    {
104
        return $this->scopeConfig->getValue(self::XML_PATH_WEBHOOK_TOKEN);
105
    }
106
}
107