Total Complexity | 5 |
Total Lines | 30 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
7 | abstract class Result |
||
8 | { |
||
9 | private $valid; |
||
10 | private $errors = []; |
||
11 | |||
12 | public function __construct(bool $valid, Error... $errors) |
||
13 | { |
||
14 | $this->valid = $valid; |
||
15 | $this->errors = $errors; |
||
16 | } |
||
17 | |||
18 | public function isValid() : bool |
||
19 | { |
||
20 | return $this->valid; |
||
21 | } |
||
22 | |||
23 | /** |
||
24 | * @return array |
||
25 | */ |
||
26 | public function getErrors(): array |
||
29 | } |
||
30 | |||
31 | public function getFirstError() : ?Error |
||
37 | } |
||
38 | } |