Skip to content

Commit

Permalink
Document StatementContext
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Sep 14, 2024
1 parent 2c4c0cd commit 1648f00
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/Analyser/StatementContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

namespace PHPStan\Analyser;

/**
* Object of this class is one of the parameters of `NodeScopeResolver::processStmtNodes()`.
*
* It determines whether loops will be analysed once or multiple times
* until the types "stabilize".
*
* When in doubt, use `StatementContext::createTopLevel()`.
*/
final class StatementContext
{

Expand All @@ -11,11 +19,17 @@ private function __construct(
{
}

/**
* @api
*/
public static function createTopLevel(): self
{
return new self(true);
}

/**
* @api
*/
public static function createDeep(): self
{
return new self(false);
Expand Down

0 comments on commit 1648f00

Please sign in to comment.