Completed
Push — master ( bca24d...1b0d8b )
by John
03:18
created

ValidationResult   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A isValid() 0 4 1
A getErrorMessages() 0 4 1
1
<?php declare(strict_types = 1);
2
/*
3
 * This file is part of the KleijnWeb\PhpApi\Descriptions package.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 */
8
9
namespace KleijnWeb\PhpApi\Descriptions\Description\Schema\Validator;
10
11
/**
12
 * @author John Kleijn <[email protected]>
13
 */
14
class ValidationResult
15
{
16
    /**
17
     * @var bool
18
     */
19
    private $valid;
20
21
    /**
22
     * @var string[]
23
     */
24
    private $errorMessages;
25
26
    /**
27
     * ValidationResult constructor.
28
     *
29
     * @param bool     $valid
30
     * @param string[] $errorMessages
31
     */
32
    public function __construct(bool $valid, array $errorMessages)
33
    {
34
        $this->valid         = $valid;
35
        $this->errorMessages = $errorMessages;
36
    }
37
38
    /**
39
     * @return bool
40
     */
41
    public function isValid(): bool
42
    {
43
        return $this->valid;
44
    }
45
46
    /**
47
     * @return string[]
48
     */
49
    public function getErrorMessages(): array
50
    {
51
        return $this->errorMessages;
52
    }
53
}
54