Test Failed
Pull Request — master (#5)
by aguevaraIL
07:24
created

Credit::slugBehaviorConfig()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 4
rs 10
1
<?php
2
3
namespace app\api\models;
4
5
use app\models as base;
6
use roaresearch\yii2\roa\hal\{Contract, ContractTrait};
7
8
/**
9
 * ROA contract to handle credit records.
10
 */
11
class Credit extends base\Credit implements Contract
12
{
13
    use ContractTrait {
14
        getLinks as getContractLinks;
15
    }
16
17
    /**
18
     * @inheritdoc
19
     */
20
    protected function assignmentClass(): string
21
    {
22
        return CreditAssignment::class;
23
    }
24
25
    /**
26
     * @inheritdoc
27
     */
28
    protected function workLogClass(): string
29
    {
30
        return CreditWorkLog::class;
31
    }
32
33
    /**
34
     * @inheritdoc
35
     */
36
    protected function slugBehaviorConfig(): array
37
    {
38
        return [
39
            'resourceName' => 'credit',
40
        ];
41
    }
42
43
    /**
44
     * @inheritdoc
45
     */
46
    public function getLinks()
47
    {
48
        return array_merge($this->getContractLinks(), [
49
            'worklog' => $this->getSelfLink() . '/worklog',
50
        ]);
51
    }
52
53
    /**
54
     * @inheritdoc
55
     */
56
    public function extraFields()
57
    {
58
        return [
59
            'workLogs',
60
            'activeWorkLog',
61
        ];
62
    }
63
}
64