1: | <?php declare(strict_types = 1); |
2: | |
3: | namespace PHPStan\Node; |
4: | |
5: | use PhpParser\Node; |
6: | use PhpParser\NodeAbstract; |
7: | |
8: | |
9: | |
10: | |
11: | final class FileNode extends NodeAbstract implements VirtualNode |
12: | { |
13: | |
14: | |
15: | |
16: | |
17: | public function __construct(private array $nodes) |
18: | { |
19: | $firstNode = $nodes[0] ?? null; |
20: | parent::__construct($firstNode !== null ? $firstNode->getAttributes() : []); |
21: | } |
22: | |
23: | |
24: | |
25: | |
26: | public function getNodes(): array |
27: | { |
28: | return $this->nodes; |
29: | } |
30: | |
31: | public function getType(): string |
32: | { |
33: | return 'PHPStan_Node_FileNode'; |
34: | } |
35: | |
36: | |
37: | |
38: | |
39: | public function getSubNodeNames(): array |
40: | { |
41: | return []; |
42: | } |
43: | |
44: | } |
45: | |