AstContainer::setAst()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
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