Completed
Push — develop ( fcce06...87d9a9 )
by Nate
02:07
created

CreateUserType   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 23
ccs 0
cts 6
cp 0
rs 10
c 0
b 0
f 0

1 Method

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