ErrorAwareTrait   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 0
dl 0
loc 32
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setErrors() 0 4 1
A getErrors() 0 4 1
A hasErrors() 0 4 1
1
<?php
2
3
namespace T4webDomain;
4
5
trait ErrorAwareTrait
6
{
7
8
    /**
9
     * @var array
10
     */
11
    private $errors = [];
12
13
    /**
14
     * @param array $errors
15
     */
16
    public function setErrors(array $errors)
17
    {
18
        $this->errors = $errors;
19
    }
20
21
    /**
22
     * @return array
23
     */
24
    public function getErrors()
25
    {
26
        return $this->errors;
27
    }
28
29
    /**
30
     * @return bool
31
     */
32
    public function hasErrors()
33
    {
34
        return !empty($this->errors);
35
    }
36
}
37