2018-06-17 03:54:44 +02:00
|
|
|
<?php
|
2018-11-06 03:57:36 +01:00
|
|
|
namespace Psalm\Internal\Scope;
|
2018-06-17 03:54:44 +02:00
|
|
|
|
2018-11-18 17:39:14 +01:00
|
|
|
use PhpParser;
|
2018-06-17 03:54:44 +02:00
|
|
|
use Psalm\CodeLocation;
|
2019-07-05 22:24:00 +02:00
|
|
|
use Psalm\Internal\Clause;
|
2018-11-11 02:34:53 +01:00
|
|
|
use Psalm\Type;
|
2018-06-17 03:54:44 +02:00
|
|
|
|
2018-12-02 00:37:49 +01:00
|
|
|
/**
|
|
|
|
* @internal
|
|
|
|
*/
|
2018-06-17 03:54:44 +02:00
|
|
|
class SwitchScope
|
|
|
|
{
|
|
|
|
/**
|
2018-11-18 17:39:14 +01:00
|
|
|
* @var array<string, Type\Union>|null
|
2018-06-17 03:54:44 +02:00
|
|
|
*/
|
2018-11-18 17:39:14 +01:00
|
|
|
public $new_vars_in_scope = null;
|
2018-11-11 02:34:53 +01:00
|
|
|
|
|
|
|
/**
|
2018-11-18 17:39:14 +01:00
|
|
|
* @var array<string, bool>
|
2018-11-11 02:34:53 +01:00
|
|
|
*/
|
2018-11-18 17:39:14 +01:00
|
|
|
public $new_vars_possibly_in_scope = [];
|
2018-11-11 02:34:53 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @var array<string, Type\Union>|null
|
|
|
|
*/
|
2018-11-18 17:39:14 +01:00
|
|
|
public $redefined_vars = null;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var array<string, Type\Union>|null
|
|
|
|
*/
|
|
|
|
public $possibly_redefined_vars = null;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var array<PhpParser\Node\Stmt>
|
|
|
|
*/
|
|
|
|
public $leftover_statements = [];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var PhpParser\Node\Expr|null
|
|
|
|
*/
|
|
|
|
public $leftover_case_equality_expr = null;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var array<int, Clause>
|
|
|
|
*/
|
|
|
|
public $negated_clauses = [];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var array<string, array<string, CodeLocation>>
|
|
|
|
*/
|
|
|
|
public $new_unreferenced_vars = [];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var array<string, bool>|null
|
|
|
|
*/
|
|
|
|
public $new_assigned_var_ids = null;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var array<string, bool>
|
|
|
|
*/
|
|
|
|
public $new_possibly_assigned_var_ids = [];
|
2018-06-17 03:54:44 +02:00
|
|
|
}
|