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 ( e4b67a...d8327a )
by Andreas
03:56
created

Contact   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
c 0
b 0
f 0
dl 0
loc 20
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A _construct() 0 3 1
A importContacts() 0 6 1
1
<?php
2
declare(strict_types=1);
3
/**
4
 */
5
namespace CommerceLeague\ActiveCampaign\Model\ResourceModel;
6
7
use CommerceLeague\ActiveCampaign\Api\Data\ContactInterface;
8
use CommerceLeague\ActiveCampaign\Setup\SchemaInterface;
9
use Magento\Framework\Exception\LocalizedException;
10
use Magento\Framework\Model\ResourceModel\Db\AbstractDb;
11
12
/**
13
 * Class Contact
14
 */
15
class Contact extends AbstractDb
16
{
17
    /**
18
     * @inheritDoc
19
     */
20
    protected function _construct()
21
    {
22
        $this->_init(SchemaInterface::CONTACT_TABLE, ContactInterface::ENTITY_ID);
23
    }
24
25
    /**
26
     * @param array $contacts
27
     * @throws LocalizedException
28
     */
29
    public function importContacts(array $contacts): void
30
    {
31
        $this->getConnection()->insertOnDuplicate(
32
            $this->getMainTable(),
33
            $contacts,
34
            [ContactInterface::EMAIL, ContactInterface::ACTIVE_CAMPAIGN_ID]
35
        );
36
    }
37
}
38