1: <?php declare(strict_types = 1);
2:
3: namespace PHPStan\Analyser;
4:
5: use PhpParser\Node;
6: use PHPStan\Node\VirtualNode;
7: use PHPStan\Turbo\ShadowedByTurboExtension;
8:
9: /**
10: * @phpstan-type ImpurePointIdentifier = 'echo'|'die'|'exit'|'propertyAssign'|'propertyAssignByRef'|'propertyUnset'|'propertyHookCall'|'methodCall'|'new'|'functionCall'|'include'|'require'|'print'|'eval'|'superglobal'|'yield'|'yieldFrom'|'static'|'global'|'betweenPhpTags'|'staticPropertyAccess'
11: * @api
12: */
13: #[ShadowedByTurboExtension(implementation: __DIR__ . '/../../turbo-ext/src/ImpurePoint.cpp')]
14: final class ImpurePoint
15: {
16:
17: /**
18: * @param Node\Expr|Node\Stmt|VirtualNode $node
19: * @param ImpurePointIdentifier $identifier
20: */
21: public function __construct(
22: private Scope $scope,
23: private Node $node,
24: private string $identifier,
25: private string $description,
26: private bool $certain,
27: )
28: {
29: }
30:
31: public function getScope(): Scope
32: {
33: return $this->scope;
34: }
35:
36: /**
37: * @return Node\Expr|Node\Stmt|VirtualNode
38: */
39: public function getNode()
40: {
41: return $this->node;
42: }
43:
44: /**
45: * @return ImpurePointIdentifier
46: */
47: public function getIdentifier(): string
48: {
49: return $this->identifier;
50: }
51:
52: public function getDescription(): string
53: {
54: return $this->description;
55: }
56:
57: public function isCertain(): bool
58: {
59: return $this->certain;
60: }
61:
62: }
63: