1: <?php declare(strict_types = 1);
2:
3: namespace PHPStan\Node;
4:
5: use Override;
6: use PhpParser\Node\Stmt\While_;
7: use PhpParser\NodeAbstract;
8: use PHPStan\Analyser\StatementExitPoint;
9:
10: /**
11: * @api
12: */
13: final class BreaklessWhileLoopNode extends NodeAbstract implements VirtualNode
14: {
15:
16: /**
17: * @param StatementExitPoint[] $exitPoints
18: */
19: public function __construct(private While_ $originalNode, private array $exitPoints, private bool $hasYield)
20: {
21: parent::__construct($originalNode->getAttributes());
22: }
23:
24: public function getOriginalNode(): While_
25: {
26: return $this->originalNode;
27: }
28:
29: /**
30: * @return StatementExitPoint[]
31: */
32: public function getExitPoints(): array
33: {
34: return $this->exitPoints;
35: }
36:
37: public function hasYield(): bool
38: {
39: return $this->hasYield;
40: }
41:
42: #[Override]
43: public function getType(): string
44: {
45: return 'PHPStan_Node_BreaklessWhileLoop';
46: }
47:
48: /**
49: * @return string[]
50: */
51: #[Override]
52: public function getSubNodeNames(): array
53: {
54: return [];
55: }
56:
57: }
58: