Resolution   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 0
dl 0
loc 38
ccs 12
cts 12
cp 1
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A createValid() 0 4 1
A createInvalid() 0 4 1
A isValid() 0 4 1
A getErrors() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Lamoda\GS1Parser\Validator;
6
7
final class Resolution
8
{
9
    /**
10
     * @var bool
11
     */
12
    private $isValid;
13
    /**
14
     * @var array
15
     */
16
    private $errors;
17
18 2
    private function __construct(bool $isValid, array $errors)
19
    {
20 2
        $this->isValid = $isValid;
21 2
        $this->errors = $errors;
22 2
    }
23
24 1
    public static function createValid(): self
25
    {
26 1
        return new static(true, []);
27
    }
28
29 1
    public static function createInvalid(array $errors): self
30
    {
31 1
        return new static(false, $errors);
32
    }
33
34 2
    public function isValid(): bool
35
    {
36 2
        return $this->isValid;
37
    }
38
39 2
    public function getErrors(): array
40
    {
41 2
        return $this->errors;
42
    }
43
44
}