1: <?php declare(strict_types = 1);
2:
3: namespace PHPStan\Node;
4:
5: use PhpParser\Node;
6: use PhpParser\Node\Expr\ArrowFunction;
7: use PhpParser\NodeAbstract;
8: use PHPStan\Type\ClosureType;
9:
10: /**
11: * @api
12: * @final
13: */
14: class InArrowFunctionNode extends NodeAbstract implements VirtualNode
15: {
16:
17: private Node\Expr\ArrowFunction $originalNode;
18:
19: public function __construct(private ClosureType $closureType, ArrowFunction $originalNode)
20: {
21: parent::__construct($originalNode->getAttributes());
22: $this->originalNode = $originalNode;
23: }
24:
25: public function getClosureType(): ClosureType
26: {
27: return $this->closureType;
28: }
29:
30: public function getOriginalNode(): Node\Expr\ArrowFunction
31: {
32: return $this->originalNode;
33: }
34:
35: public function getType(): string
36: {
37: return 'PHPStan_Node_InArrowFunctionNode';
38: }
39:
40: /**
41: * @return string[]
42: */
43: public function getSubNodeNames(): array
44: {
45: return [];
46: }
47:
48: }
49: