CreateConnection   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 3
dl 0
loc 24
ccs 0
cts 11
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A newRecord() 0 6 1
A populate() 0 5 1
1
<?php
2
3
/**
4
 * @copyright  Copyright (c) Flipbox Digital Limited
5
 * @license    https://flipboxfactory.com/software/hubspot/license
6
 * @link       https://www.flipboxfactory.com/software/hubspot/
7
 */
8
9
namespace flipbox\craft\hubspot\actions\connections;
10
11
use flipbox\craft\hubspot\records\Connection;
12
use flipbox\craft\integration\actions\connections\CreateConnection as CreateIntegrationConnection;
13
use yii\db\ActiveRecord;
14
15
/**
16
 * @author Flipbox Factory <[email protected]>
17
 * @since 1.0.0
18
 */
19
class CreateConnection extends CreateIntegrationConnection
20
{
21
    use PopulateConnectionTrait;
22
23
    /**
24
     * @inheritdoc
25
     */
26
    protected function newRecord(array $config = []): ActiveRecord
27
    {
28
        $record = new Connection();
29
        $record->setAttributes($config);
30
        return $record;
31
    }
32
33
    /**
34
     * @param Connection $record
35
     * @inheritdoc
36
     */
37
    protected function populate(ActiveRecord $record): ActiveRecord
38
    {
39
        parent::populate($record);
40
        return $this->populateSettings($record);
41
    }
42
}
43