CreateConnection::populate()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 0
cts 5
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
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