Completed
Push — master ( 1961b2...5981e3 )
by Andrii
04:35
created

CalculateValueCommand   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A rules() 0 6 1
A validateItem() 0 5 1
1
<?php
2
3
namespace hiqdev\billing\hiapi\commands\order;
4
5
class CalculateValueCommand extends \hiapi\commands\Command
6
{
7
    protected $handlerClass = CalculateOrderValueHandler::class;
8
9
    public function rules()
10
    {
11
        return [
12
            ['items', 'each', 'rule' => ['validateItem']],
13
        ];
14
    }
15
16
    public function validateItem($attribute, $params, $validator)
17
    {
18
        var_dump(compact('attribute','params','validator'));
0 ignored issues
show
Security Debugging Code introduced by
var_dump(compact('attrib...params', 'validator')); looks like debug code. Are you sure you do not want to remove it? This might expose sensitive data.
Loading history...
19
        die;
0 ignored issues
show
Coding Style Compatibility introduced by
The method validateItem() contains an exit expression.

An exit expression should only be used in rare cases. For example, if you write a short command line script.

In most cases however, using an exit expression makes the code untestable and often causes incompatibilities with other libraries. Thus, unless you are absolutely sure it is required here, we recommend to refactor your code to avoid its usage.

Loading history...
20
    }
21
}
22