RenewCalculation::rules()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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