ValidationResult   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 1
Metric Value
eloc 6
c 2
b 0
f 1
dl 0
loc 25
rs 10
ccs 9
cts 9
cp 1
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A isValid() 0 3 1
A hasErrors() 0 3 1
A __construct() 0 3 1
A getErrors() 0 3 1
1
<?php
2
3
namespace erasys\OpenApi\Validator;
4
5
class ValidationResult
6
{
7
    /**
8
     * @var array
9
     */
10
    private $errors;
11
12 6
    public function __construct(array $errors)
13
    {
14 6
        $this->errors = $errors;
15 6
    }
16
17 6
    public function isValid(): bool
18
    {
19 6
        return !$this->hasErrors();
20
    }
21
22 3
    public function getErrors(): array
23
    {
24 3
        return $this->errors;
25
    }
26
27 6
    public function hasErrors(): bool
28
    {
29 6
        return !empty($this->errors);
30
    }
31
}
32