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

[TASK] Add AfterFunctionLikeAnalysisEvent::getFunctionlikeStorage #7532

Merged
merged 1 commit into from Jan 30, 2022
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
2 changes: 1 addition & 1 deletion src/Psalm/Internal/EventDispatcher.php
Expand Up @@ -578,7 +578,7 @@ public function dispatchAfterFunctionLikeAnalysis(AfterFunctionLikeAnalysisEvent
$file_replacements = $event->getFileReplacements();
if ($handler::afterStatementAnalysis(
$event->getStmt(),
$event->getClasslikeStorage(),
$event->getFunctionlikeStorage(),
$event->getStatementsSource(),
$event->getCodebase(),
$file_replacements
Expand Down
Expand Up @@ -19,7 +19,7 @@ class AfterFunctionLikeAnalysisEvent
/**
* @var FunctionLikeStorage
*/
private $classlike_storage;
private $functionlike_storage;
/**
* @var StatementsSource
*/
Expand Down Expand Up @@ -48,15 +48,15 @@ class AfterFunctionLikeAnalysisEvent
*/
public function __construct(
Node\FunctionLike $stmt,
FunctionLikeStorage $classlike_storage,
FunctionLikeStorage $functionlike_storage,
StatementsSource $statements_source,
Codebase $codebase,
array $file_replacements,
NodeTypeProvider $node_type_provider,
Context $context
) {
$this->stmt = $stmt;
$this->classlike_storage = $classlike_storage;
$this->functionlike_storage = $functionlike_storage;
$this->statements_source = $statements_source;
$this->codebase = $codebase;
$this->file_replacements = $file_replacements;
Expand All @@ -69,9 +69,17 @@ public function getStmt(): Node\FunctionLike
return $this->stmt;
}

/**
* @deprecated Will be removed in Psalm v5.0, use getFunctionlikeStorage() instead
*/
public function getClasslikeStorage(): FunctionLikeStorage
{
return $this->classlike_storage;
return $this->functionlike_storage;
}

public function getFunctionlikeStorage(): FunctionLikeStorage
{
return $this->functionlike_storage;
}

public function getStatementsSource(): StatementsSource
Expand Down