Validate   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
eloc 11
dl 0
loc 18
ccs 10
cts 10
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getLogCategory() 0 2 1
A getLogMessage() 0 10 2
1
<?php
2
namespace execut\import\components\parser\exception;
3
4
5
class Validate extends Exception
6
{
7
    public $errors;
8
    public $attribute = null;
9 1
    public function getLogMessage() {
10 1
        $errors = [];
11 1
        foreach ($this->errors as $value) {
12 1
            $errors[] = implode(', ', $value);
13
        }
14
15 1
        return  \Yii::t('app', 'Column {column} attribute {attribute} validation errors: {errors}', [
16 1
            'attribute' => $this->attribute,
17 1
            'column' => $this->columnNbr,
18 1
            'errors' => implode(', ', $errors),
19
        ]);
20
    }
21 1
    public function getLogCategory() {
22 1
        return 'import.validate.' . $this->columnNbr . '.' . $this->attribute;
23
    }
24
}