startTokenPosition = $startTokenPosition; $this->variableName = $variableName; $this->type = $type; $this->variable = $variable; $this->nestingHash = $nestingHash; } public function isName(string $name) : bool { return $this->variableName === $name; } public function getStartTokenPosition() : int { return $this->startTokenPosition; } public function isType(string $type) : bool { return $this->type === $type; } public function getVariableNode() : \PhpParser\Node\Expr\Variable { return $this->variable; } public function getParentNode() : \PhpParser\Node { $parentNode = $this->variable->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::PARENT_NODE); if (!$parentNode instanceof \PhpParser\Node) { throw new \Rector\Core\Exception\ShouldNotHappenException(); } return $parentNode; } public function getNestingHash() : ?string { return $this->nestingHash; } }