Skip to content

Commit

Permalink
Merge branch refs/heads/1.11.x into 1.12.x
Browse files Browse the repository at this point in the history
  • Loading branch information
phpstan-bot authored Jul 20, 2024
2 parents 7d64d5c + 27e0f91 commit d930bcf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/Analyser/NodeScopeResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -394,10 +394,14 @@ public function processStmtNodes(
if ($stmtCount === 0 && $shouldCheckLastStatement) {
/** @var Node\Stmt\Function_|Node\Stmt\ClassMethod|Expr\Closure $parentNode */
$parentNode = $parentNode;
$returnTypeNode = $parentNode->returnType;
if ($parentNode instanceof Expr\Closure) {
$parentNode = new Node\Stmt\Expression($parentNode, $parentNode->getAttributes());
}
$nodeCallback(new ExecutionEndNode(
$parentNode,
$statementResult,
$parentNode->returnType !== null,
$returnTypeNode !== null,
), $scope);
}

Expand Down
4 changes: 2 additions & 2 deletions src/Node/ExecutionEndNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ class ExecutionEndNode extends NodeAbstract implements VirtualNode
{

public function __construct(
private Node $node,
private Node\Stmt $node,
private StatementResult $statementResult,
private bool $hasNativeReturnTypehint,
)
{
parent::__construct($node->getAttributes());
}

public function getNode(): Node
public function getNode(): Node\Stmt
{
return $this->node;
}
Expand Down

0 comments on commit d930bcf

Please sign in to comment.