Completed
Pull Request — master (#2)
by
unknown
06:17 queued 03:34
created

Canceled   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
B validate() 0 24 6
1
<?php
2
3
namespace Iris\Validator;
4
5
class Canceled extends AbstractValidator
6
{
7
    /**
8
     * {@inheritdoc}
9
     * @param \Iris\Transfer\Tracking\Canceled $transfer
10
     */
11 8
    protected function validate($transfer)
12
    {
13 8
        if (empty($transfer->getReasonDetail())) {
14 3
            $this->errors[] = 'Reason detail can\'t be empty';
15 3
        }
16
17 8
        if (empty($transfer->getReason())) {
18 3
            $this->errors[] = 'Reason can\'t be empty';
19 3
        }
20
21 8
        if (empty($transfer->getVentureOrderItemId())) {
22 3
            $this->errors[] = 'Order item id can\'t be empty';
23 3
        }
24
25 8
        if (empty($transfer->getPartnerCode())) {
26 3
            $this->errors[] = 'Partner code can\'t be empty';
27 3
        }
28
29 8
        if (empty($transfer->getVentureOrderNumber())) {
30 3
            $this->errors[] = 'Venture order number can\'t be empty';
31 3
        }
32
33 8
        return empty($this->errors);
34
    }
35
}
36