| 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'|'propertyAssignByRef'|'propertyUnset'|'methodCall'|'new'|'functionCall'|'include'|'require'|'print'|'eval'|'superglobal'|'yield'|'yieldFrom'|'static'|'global'|'betweenPhpTags' | 
| 10: | * @api | 
| 11: | * @final | 
| 12: | */ | 
| 13: | class ImpurePoint | 
| 14: | { | 
| 15: | |
| 16: | /** | 
| 17: | * @param Node\Expr|Node\Stmt|VirtualNode $node | 
| 18: | * @param ImpurePointIdentifier $identifier | 
| 19: | */ | 
| 20: | public function __construct( | 
| 21: | private Scope $scope, | 
| 22: | private Node $node, | 
| 23: | private string $identifier, | 
| 24: | private string $description, | 
| 25: | private bool $certain, | 
| 26: | ) | 
| 27: | { | 
| 28: | } | 
| 29: | |
| 30: | public function getScope(): Scope | 
| 31: | { | 
| 32: | return $this->scope; | 
| 33: | } | 
| 34: | |
| 35: | /** | 
| 36: | * @return Node\Expr|Node\Stmt|VirtualNode | 
| 37: | */ | 
| 38: | public function getNode() | 
| 39: | { | 
| 40: | return $this->node; | 
| 41: | } | 
| 42: | |
| 43: | /** | 
| 44: | * @return ImpurePointIdentifier | 
| 45: | */ | 
| 46: | public function getIdentifier(): string | 
| 47: | { | 
| 48: | return $this->identifier; | 
| 49: | } | 
| 50: | |
| 51: | public function getDescription(): string | 
| 52: | { | 
| 53: | return $this->description; | 
| 54: | } | 
| 55: | |
| 56: | public function isCertain(): bool | 
| 57: | { | 
| 58: | return $this->certain; | 
| 59: | } | 
| 60: | |
| 61: | } | 
| 62: |