1: <?php declare(strict_types = 1);
2:
3: namespace PHPStan\Node;
4:
5: use PhpParser\Node\Expr\Yield_;
6: use PhpParser\Node\Expr\YieldFrom;
7: use PHPStan\Analyser\Scope;
8: use PHPStan\Turbo\ReferencedByTurboExtension;
9:
10: /**
11: * A yield in the body of a function or a method, with the scope it is in.
12: *
13: * @api
14: */
15: #[ReferencedByTurboExtension(key: 'yieldStatement')]
16: final class YieldStatement
17: {
18:
19: public function __construct(private Scope $scope, private Yield_|YieldFrom $yieldNode)
20: {
21: }
22:
23: public function getScope(): Scope
24: {
25: return $this->scope;
26: }
27:
28: public function getYieldNode(): Yield_|YieldFrom
29: {
30: return $this->yieldNode;
31: }
32:
33: }
34: