2018-11-18 17:39:14 +01:00
|
|
|
<?php
|
|
|
|
namespace Psalm\Internal\Scope;
|
|
|
|
|
|
|
|
use Psalm\CodeLocation;
|
|
|
|
use Psalm\Context;
|
|
|
|
use Psalm\Type;
|
|
|
|
|
2018-12-02 00:37:49 +01:00
|
|
|
/**
|
|
|
|
* @internal
|
|
|
|
*/
|
2018-11-18 17:39:14 +01:00
|
|
|
class CaseScope
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @var array<string, array<string, CodeLocation>>
|
|
|
|
*/
|
|
|
|
public $unreferenced_vars = [];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var Context
|
|
|
|
*/
|
|
|
|
public $parent_context;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var array<string, Type\Union>|null
|
|
|
|
*/
|
|
|
|
public $break_vars;
|
|
|
|
|
2019-11-25 21:20:31 +01:00
|
|
|
public function __construct(Context $parent_context)
|
|
|
|
{
|
|
|
|
$this->parent_context = $parent_context;
|
|
|
|
}
|
|
|
|
|
2018-11-18 17:39:14 +01:00
|
|
|
public function __destruct()
|
|
|
|
{
|
|
|
|
/** @psalm-suppress PossiblyNullPropertyAssignmentValue */
|
|
|
|
$this->parent_context = null;
|
|
|
|
}
|
|
|
|
}
|