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

ValidationResult::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 2
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