Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions packages/NodeTypeResolver/Node/AttributeKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,11 +247,6 @@ final class AttributeKey
*/
public const IS_IN_IF = 'is_in_if';

/**
* @var string
*/
public const IS_ISSET_VAR = 'is_isset_var';

/**
* @var string
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
use PhpParser\Node\Expr\Array_;
use PhpParser\Node\Expr\ArrayDimFetch;
use PhpParser\Node\Expr\Closure;
use PhpParser\Node\Expr\Isset_;
use PhpParser\Node\Expr\PropertyFetch;
use PhpParser\Node\Expr\StaticPropertyFetch;
use PhpParser\Node\Expr\Variable;
Expand Down Expand Up @@ -52,8 +51,8 @@ public function enterNode(Node $node): ?Node
return null;
}

if ($node instanceof Isset_ || $node instanceof Unset_) {
$this->processContextInIssetOrUnset($node);
if ($node instanceof Unset_) {
$this->processContextInUnset($node);
return null;
}

Expand Down Expand Up @@ -115,16 +114,8 @@ static function (Node $subNode) {
);
}

private function processContextInIssetOrUnset(Isset_|Unset_ $node): void
private function processContextInUnset(Unset_ $node): void
{
if ($node instanceof Isset_) {
foreach ($node->vars as $var) {
$var->setAttribute(AttributeKey::IS_ISSET_VAR, true);
}

return;
}

foreach ($node->vars as $var) {
$var->setAttribute(AttributeKey::IS_UNSET_VAR, true);
}
Expand Down