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