Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NodeTypeResolver] Remove AttributeKey::IS_RETURN_EXPR from ContextNodeVisitor #4502

Merged
merged 2 commits into from
Jul 13, 2023
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.
Jump to
Jump to file
Failed to load files.
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 @@ -292,11 +292,6 @@ final class AttributeKey
*/
public const IS_NEW_INSTANCE_NAME = 'is_new_instance_name';

/**
* @var string
*/
public const IS_RETURN_EXPR = 'is_return_expr';

/**
* @var string
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use PhpParser\Node;
use PhpParser\Node\Arg;
use PhpParser\Node\Attribute;
use PhpParser\Node\Expr;
use PhpParser\Node\Expr\Array_;
use PhpParser\Node\Expr\ArrayDimFetch;
use PhpParser\Node\Expr\Closure;
Expand All @@ -26,7 +25,6 @@
use PhpParser\Node\Stmt\Foreach_;
use PhpParser\Node\Stmt\Function_;
use PhpParser\Node\Stmt\If_;
use PhpParser\Node\Stmt\Return_;
use PhpParser\Node\Stmt\Unset_;
use PhpParser\Node\Stmt\While_;
use PhpParser\NodeTraverser;
Expand Down Expand Up @@ -69,11 +67,6 @@ public function enterNode(Node $node): ?Node
return null;
}

if ($node instanceof Return_ && $node->expr instanceof Expr) {
$node->expr->setAttribute(AttributeKey::IS_RETURN_EXPR, true);
return null;
}

if ($node instanceof Arg) {
$node->value->setAttribute(AttributeKey::IS_ARG_VALUE, true);
return null;
Expand Down