2016-11-11 23:13:13 +01:00
|
|
|
<?php
|
2018-11-06 03:57:36 +01:00
|
|
|
namespace Psalm\Internal\Scope;
|
2017-12-03 00:28:18 +01:00
|
|
|
|
2018-11-06 03:57:36 +01:00
|
|
|
use Psalm\Internal\Clause;
|
2017-12-03 00:28:18 +01:00
|
|
|
use Psalm\Type;
|
2016-11-11 23:13:13 +01:00
|
|
|
|
2018-12-02 00:37:49 +01:00
|
|
|
/**
|
|
|
|
* @internal
|
|
|
|
*/
|
2016-11-11 23:13:13 +01:00
|
|
|
class IfScope
|
|
|
|
{
|
|
|
|
/**
|
2016-12-24 19:23:22 +01:00
|
|
|
* @var array<string, Type\Union>|null
|
2016-11-11 23:13:13 +01:00
|
|
|
*/
|
|
|
|
public $new_vars = null;
|
|
|
|
|
|
|
|
/**
|
2017-12-02 19:32:20 +01:00
|
|
|
* @var array<string, bool>
|
2016-11-11 23:13:13 +01:00
|
|
|
*/
|
|
|
|
public $new_vars_possibly_in_scope = [];
|
|
|
|
|
2017-05-27 02:16:18 +02:00
|
|
|
/**
|
2016-12-24 19:23:22 +01:00
|
|
|
* @var array<string, Type\Union>|null
|
2016-11-11 23:13:13 +01:00
|
|
|
*/
|
|
|
|
public $redefined_vars = null;
|
|
|
|
|
2018-01-28 23:28:34 +01:00
|
|
|
/**
|
2020-11-01 17:26:42 +01:00
|
|
|
* @var array<string, int>|null
|
2018-01-28 23:28:34 +01:00
|
|
|
*/
|
|
|
|
public $assigned_var_ids = null;
|
|
|
|
|
2018-05-18 17:02:50 +02:00
|
|
|
/**
|
|
|
|
* @var array<string, bool>
|
|
|
|
*/
|
|
|
|
public $possibly_assigned_var_ids = [];
|
|
|
|
|
2016-11-11 23:13:13 +01:00
|
|
|
/**
|
2016-12-24 19:23:22 +01:00
|
|
|
* @var array<string, Type\Union>
|
2016-11-11 23:13:13 +01:00
|
|
|
*/
|
|
|
|
public $possibly_redefined_vars = [];
|
|
|
|
|
|
|
|
/**
|
2017-02-24 01:36:51 +01:00
|
|
|
* @var array<string, bool>
|
2016-11-11 23:13:13 +01:00
|
|
|
*/
|
|
|
|
public $updated_vars = [];
|
|
|
|
|
|
|
|
/**
|
2018-05-13 01:38:43 +02:00
|
|
|
* @var array<string, array<int, array<int, string>>>
|
2016-11-11 23:13:13 +01:00
|
|
|
*/
|
|
|
|
public $negated_types = [];
|
|
|
|
|
2018-01-20 17:48:16 +01:00
|
|
|
/**
|
2019-12-07 07:23:35 +01:00
|
|
|
* @var array<string, bool>
|
2018-01-20 17:48:16 +01:00
|
|
|
*/
|
|
|
|
public $if_cond_changed_var_ids = [];
|
|
|
|
|
2016-11-11 23:13:13 +01:00
|
|
|
/**
|
|
|
|
* @var array<string, string>|null
|
|
|
|
*/
|
|
|
|
public $negatable_if_types = null;
|
|
|
|
|
2017-03-16 19:45:45 +01:00
|
|
|
/**
|
2019-10-17 03:55:11 +02:00
|
|
|
* @var list<Clause>
|
2017-03-16 19:45:45 +01:00
|
|
|
*/
|
2018-05-03 17:38:27 +02:00
|
|
|
public $negated_clauses = [];
|
2017-03-16 19:45:45 +01:00
|
|
|
|
|
|
|
/**
|
2018-05-14 22:29:51 +02:00
|
|
|
* These are the set of clauses that could be applied after the `if`
|
2019-03-25 02:16:36 +01:00
|
|
|
* statement, if the `if` statement contains branches with leaving statements,
|
2018-05-14 22:29:51 +02:00
|
|
|
* and the else leaves too
|
|
|
|
*
|
2020-10-16 17:17:52 +02:00
|
|
|
* @var list<Clause>
|
2017-03-16 19:45:45 +01:00
|
|
|
*/
|
2017-03-18 18:37:00 +01:00
|
|
|
public $reasonable_clauses = [];
|
2017-09-03 00:15:52 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Variables that were mixed, but are no longer
|
|
|
|
*
|
2018-01-29 03:43:26 +01:00
|
|
|
* @var array<string, Type\Union>|null
|
2017-09-03 00:15:52 +02:00
|
|
|
*/
|
|
|
|
public $possible_param_types = null;
|
2017-12-03 00:28:18 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string[]
|
|
|
|
*/
|
|
|
|
public $final_actions = [];
|
2020-10-17 18:29:57 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @var ?\Psalm\Context
|
|
|
|
*/
|
|
|
|
public $mic_drop_context;
|
2016-11-11 23:13:13 +01:00
|
|
|
}
|