Completed
Push — master ( cf838f...441ca2 )
by Dmitry
04:31
created

ServerOrderPurchase   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
c 1
b 0
f 1
lcom 0
cbo 2
dl 0
loc 15
ccs 0
cts 11
cp 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A operation() 0 4 1
A rules() 0 7 1
1
<?php
2
3
/*
4
 * Server module for HiPanel
5
 *
6
 * @link      https://github.com/hiqdev/hipanel-module-server
7
 * @package   hipanel-module-server
8
 * @license   BSD-3-Clause
9
 * @copyright Copyright (c) 2015-2016, HiQDev (http://hiqdev.com/)
10
 */
11
12
namespace hipanel\modules\server\cart;
13
14
use yii\base\InvalidConfigException;
15
16
/**
17
 * Class ServerOrderPurchase
18
 * @package hipanel\modules\server\cart
19
 */
20
class ServerOrderPurchase extends AbstractServerPurchase
21
{
22
    /** {@inheritdoc} */
23
    public static function operation()
24
    {
25
        return 'Buy';
26
    }
27
    public function rules()
28
    {
29
        throw new InvalidConfigException('Server purchasing is not implemented yet. '); // todo
30
        return array_merge(parent::rules(), [
0 ignored issues
show
Unused Code introduced by
// todo return array_mer...pires'), 'required'))); does not seem to be reachable.

This check looks for unreachable code. It uses sophisticated control flow analysis techniques to find statements which will never be executed.

Unreachable code is most often the result of return, die or exit statements that have been added for debug purposes.

function fx() {
    try {
        doSomething();
        return true;
    }
    catch (\Exception $e) {
        return false;
    }

    return false;
}

In the above example, the last return false will never be executed, because a return statement has already been met in every possible execution path.

Loading history...
31
            [['expires'], 'required'],
32
        ]);
33
    }
34
}
35