OpenvzPackage::getResourceTitle_hdd()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
c 0
b 0
f 0
ccs 0
cts 3
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\models;
12
13
use Yii;
14
15
/**
16
 * Class OpenvzPackage.
17
 * @property string $name
18
 */
19
class OpenvzPackage extends Package
20
{
21
    protected function getResourceValue_cpu()
22
    {
23
        $part = $this->getPartByType('cpu');
0 ignored issues
show
Bug introduced by
The method getPartByType() does not exist on hipanel\modules\server\models\OpenvzPackage. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

23
        /** @scrutinizer ignore-call */ 
24
        $part = $this->getPartByType('cpu');
Loading history...
24
        preg_match('/((\d+) MHz)$/i', $part->partno, $matches);
25
26
        return Yii::t('hipanel:server', '{0, number} MHz', $matches[2]);
27
    }
28
29
    protected function getResourceTitle_hdd()
30
    {
31
        return Yii::t('hipanel:server', 'HDD + SSD cache');
32
    }
33
34
    /** {@inheritdoc} */
35
    public function getLocations()
36
    {
37
        return [
38
            // RED ask
39
//            3 => Yii::t('hipanel:server', 'Netherlands, Amsterdam'),
40
            2 => Yii::t('hipanel:server', 'USA, Ashburn'),
41
        ];
42
    }
43
}
44