AstContainer   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
eloc 6
dl 0
loc 16
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setAst() 0 3 1
A getAst() 0 7 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