Validate::getLogCategory()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 2
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
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
}