Completed
Push — develop ( 856b14...45ab37 )
by Nate
17:44
created

Create   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 4
dl 0
loc 21
ccs 0
cts 8
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A newRecord() 0 12 2
1
<?php
2
3
/**
4
 * @copyright  Copyright (c) Flipbox Digital Limited
5
 * @license    https://flipboxfactory.com/software/patron/license
6
 * @link       https://www.flipboxfactory.com/software/patron/
7
 */
8
9
namespace flipbox\patron\actions\provider\instance;
10
11
use flipbox\ember\actions\record\RecordCreate;
12
use flipbox\patron\Patron;
13
use flipbox\patron\records\Provider;
14
use flipbox\patron\records\ProviderInstance;
15
use yii\db\ActiveRecord;
16
17
/**
18
 * @author Flipbox Factory <[email protected]>
19
 * @since 1.0.0
20
 */
21
class Create extends RecordCreate
22
{
23
    use traits\Populate, traits\Save;
24
25
    /**
26
     * @inheritdoc
27
     * @return Provider
28
     */
29
    protected function newRecord(array $config = []): ActiveRecord
30
    {
31
        /** @var ProviderInstance $record */
32
        $record = new ProviderInstance();
33
34
        // Do we need to set properties too
35
        if (!empty($config)) {
36
            $record->setAttributes($config);
37
        }
38
39
        return $record;
40
    }
41
}
42