Passed
Push — master ( 46dd23...a76d17 )
by Dmitry
03:18
created

RenewCalculation   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
eloc 9
dl 0
loc 20
c 0
b 0
f 0
ccs 0
cts 12
cp 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A rules() 0 5 1
A init() 0 7 1
1
<?php
2
/**
3
 * Server module for HiPanel
4
 *
5
 * @link      https://github.com/hiqdev/hipanel-module-server
6
 * @package   hipanel-module-server
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2015-2019, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hipanel\modules\server\cart;
12
13
/**
14
 * Class RenewCalculation performs calculation for server renewal operation.
15
 */
16
class RenewCalculation extends \hipanel\modules\finance\cart\Calculation
17
{
18
    use \hipanel\base\ModelTrait;
19
20
    /** {@inheritdoc} */
21
    public function init()
22
    {
23
        parent::init();
24
25
        $this->client = $this->position->getModel()->client;
0 ignored issues
show
Bug Best Practice introduced by
The property client does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
26
        $this->seller = $this->position->getModel()->seller;
0 ignored issues
show
Bug Best Practice introduced by
The property seller does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
27
        $this->object = 'server';
0 ignored issues
show
Bug Best Practice introduced by
The property object does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
28
    }
29
30
    /** {@inheritdoc} */
31
    public function rules()
32
    {
33
        return array_merge(parent::rules(), [
34
            [['server', 'expires'], 'safe'],
35
            [['id'], 'integer'],
36
        ]);
37
    }
38
}
39