Skip to content

Commit

Permalink
Merge pull request #7532 from ohader/event-nameing-4x
Browse files Browse the repository at this point in the history
[TASK] Add AfterFunctionLikeAnalysisEvent::getFunctionlikeStorage
  • Loading branch information
orklah committed Jan 30, 2022
2 parents 286176f + 1e072cb commit 4729eb0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
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

0 comments on commit 4729eb0

Please sign in to comment.