Total Complexity | 5 |
Total Lines | 42 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | abstract class ASTValidationContext |
||
12 | { |
||
13 | /** @var DocumentNode */ |
||
14 | protected $ast; |
||
15 | |||
16 | /** @var Error[] */ |
||
17 | protected $errors; |
||
18 | |||
19 | /** @var Schema */ |
||
20 | protected $schema; |
||
21 | |||
22 | 724 | public function __construct(DocumentNode $ast, ?Schema $schema = null) |
|
23 | { |
||
24 | 724 | $this->ast = $ast; |
|
25 | 724 | $this->schema = $schema; |
|
26 | 724 | $this->errors = []; |
|
27 | 724 | } |
|
28 | |||
29 | 223 | public function reportError(Error $error) |
|
30 | { |
||
31 | 223 | $this->errors[] = $error; |
|
32 | 223 | } |
|
33 | |||
34 | /** |
||
35 | * @return Error[] |
||
36 | */ |
||
37 | 724 | public function getErrors() |
|
38 | { |
||
39 | 724 | return $this->errors; |
|
40 | } |
||
41 | |||
42 | /** |
||
43 | * @return DocumentNode |
||
44 | */ |
||
45 | 441 | public function getDocument() |
|
48 | } |
||
49 | |||
50 | 424 | public function getSchema() : ?Schema |
|
51 | { |
||
55 |