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: | |
12: | class FileNode extends NodeAbstract implements VirtualNode |
13: | { |
14: | |
15: | |
16: | |
17: | |
18: | public function __construct(private array $nodes) |
19: | { |
20: | $firstNode = $nodes[0] ?? null; |
21: | parent::__construct($firstNode !== null ? $firstNode->getAttributes() : []); |
22: | } |
23: | |
24: | |
25: | |
26: | |
27: | public function getNodes(): array |
28: | { |
29: | return $this->nodes; |
30: | } |
31: | |
32: | public function getType(): string |
33: | { |
34: | return 'PHPStan_Node_FileNode'; |
35: | } |
36: | |
37: | |
38: | |
39: | |
40: | public function getSubNodeNames(): array |
41: | { |
42: | return []; |
43: | } |
44: | |
45: | } |
46: | |