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