AstContainer::getAst()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 7
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 0
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Jerowork\GraphqlAttributeSchema;
6
7
use LogicException;
8
9
final class AstContainer
10
{
11
    private Ast $ast;
12
13 22
    public function setAst(Ast $ast): void
14
    {
15 22
        $this->ast = $ast;
16
    }
17
18 21
    public function getAst(): Ast
19
    {
20 21
        if (!isset($this->ast)) {
21 1
            throw new LogicException('Ast container has not been set');
22
        }
23
24 20
        return $this->ast;
25
    }
26
}
27