Passed
Pull Request — master (#68)
by Björn
03:29
created

FileAST::getAst()   A

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 0
crap 1
1
<?php
2
3
namespace ComposerRequireChecker\ASTLocator;
4
5
use PhpParser\Node;
6
7
class FileAST
8
{
9
    /**
10
     * @var string
11
     */
12
    private $file;
13
14
    /**
15
     * @var array
16
     */
17
    private $ast;
18
19
    /**
20
     * @param string $file
21
     * @param array|null $ast
22
     *
23
     */
24 1
    public function __construct(string $file, ?array $ast)
25
    {
26 1
        $this->file = $file;
27 1
        $this->ast = $ast ?? [];
28 1
    }
29
30
    /**
31
     * @return string
32
     */
33 1
    public function getFile(): string
34
    {
35 1
        return $this->file;
36
    }
37
38
    /**
39
     * @return Node[]
40
     */
41 1
    public function getAst(): array
42
    {
43 1
        return $this->ast;
44
    }
45
}
46