Skip to content

Commit

Permalink
[TASK] Add AfterFunctionLikeAnalysisEvent::getFunctionlikeStorage
Browse files Browse the repository at this point in the history
AfterFunctionLikeAnalysisEvent's method `getClasslikeStorage` actually
returned the current `FunctionLikeStorage`. This change streamlines the
naming and adds corresponding `getFunctionlikeStorage` method.
  • Loading branch information
ohader committed Jan 30, 2022
1 parent 64d06c6 commit 2ce28f7
Showing 1 changed file with 12 additions and 4 deletions.
Expand Up @@ -19,7 +19,7 @@ final class AfterFunctionLikeAnalysisEvent
/**
* @var FunctionLikeStorage
*/
private $classlike_storage;
private $functionlike_storage;
/**
* @var StatementsSource
*/
Expand Down Expand Up @@ -49,15 +49,15 @@ final 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 @@ -70,9 +70,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 2ce28f7

Please sign in to comment.