2016-12-30 12:41:14 -05:00
|
|
|
<?php
|
|
|
|
namespace Psalm\Storage;
|
|
|
|
|
2017-02-08 00:28:26 -05:00
|
|
|
use Psalm\CodeLocation;
|
2016-12-30 12:41:14 -05:00
|
|
|
use Psalm\Type;
|
|
|
|
|
|
|
|
class ClassLikeStorage
|
|
|
|
{
|
2019-02-24 23:21:28 +02:00
|
|
|
use CustomMetadataTrait;
|
|
|
|
|
2016-12-30 12:41:14 -05:00
|
|
|
/**
|
|
|
|
* A lookup table for public class constants
|
|
|
|
*
|
|
|
|
* @var array<string, Type\Union>
|
|
|
|
*/
|
|
|
|
public $public_class_constants = [];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A lookup table for protected class constants
|
|
|
|
*
|
|
|
|
* @var array<string, Type\Union>
|
|
|
|
*/
|
|
|
|
public $protected_class_constants = [];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A lookup table for private class constants
|
|
|
|
*
|
|
|
|
* @var array<string, Type\Union>
|
|
|
|
*/
|
|
|
|
public $private_class_constants = [];
|
|
|
|
|
2018-10-26 16:17:15 -04:00
|
|
|
/**
|
2019-06-04 11:14:49 -04:00
|
|
|
* A lookup table for class constant name locations
|
2018-10-26 16:17:15 -04:00
|
|
|
*
|
|
|
|
* @var array<string, CodeLocation>
|
|
|
|
*/
|
|
|
|
public $class_constant_locations = [];
|
|
|
|
|
2019-06-04 11:14:49 -04:00
|
|
|
/**
|
|
|
|
* A lookup table for class constant statement locations
|
|
|
|
*
|
|
|
|
* @var array<string, CodeLocation>
|
|
|
|
*/
|
|
|
|
public $class_constant_stmt_locations = [];
|
|
|
|
|
2018-06-27 21:53:25 -04:00
|
|
|
/**
|
|
|
|
* A lookup table for nodes of unresolvable public class constants
|
|
|
|
*
|
|
|
|
* @var array<string, \PhpParser\Node\Expr>
|
|
|
|
*/
|
|
|
|
public $public_class_constant_nodes = [];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A lookup table for nodes of unresolvable protected class constants
|
|
|
|
*
|
|
|
|
* @var array<string, \PhpParser\Node\Expr>
|
|
|
|
*/
|
|
|
|
public $protected_class_constant_nodes = [];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A lookup table for nodes of unresolvable private class constants
|
|
|
|
*
|
|
|
|
* @var array<string, \PhpParser\Node\Expr>
|
|
|
|
*/
|
|
|
|
public $private_class_constant_nodes = [];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Aliases to help Psalm understand constant refs
|
|
|
|
*
|
|
|
|
* @var ?\Psalm\Aliases
|
|
|
|
*/
|
|
|
|
public $aliases;
|
|
|
|
|
2016-12-30 12:41:14 -05:00
|
|
|
/**
|
|
|
|
* @var bool
|
|
|
|
*/
|
2017-07-25 16:11:02 -04:00
|
|
|
public $populated = false;
|
2016-12-30 12:41:14 -05:00
|
|
|
|
2018-01-31 23:27:25 -05:00
|
|
|
/**
|
|
|
|
* @var bool
|
|
|
|
*/
|
|
|
|
public $stubbed = false;
|
|
|
|
|
2017-07-08 21:19:16 -04:00
|
|
|
/**
|
2017-02-09 20:35:17 -05:00
|
|
|
* @var bool
|
|
|
|
*/
|
|
|
|
public $deprecated = false;
|
|
|
|
|
2018-12-01 18:37:49 -05:00
|
|
|
/**
|
|
|
|
* @var bool
|
|
|
|
*/
|
|
|
|
public $internal = false;
|
|
|
|
|
2019-05-09 23:33:27 +01:00
|
|
|
/**
|
|
|
|
* @var null|string
|
|
|
|
*/
|
2019-05-11 20:39:53 +01:00
|
|
|
public $psalm_internal = null;
|
2019-05-09 23:33:27 +01:00
|
|
|
|
2018-08-10 13:25:25 -04:00
|
|
|
/**
|
|
|
|
* @var array<string, bool>
|
|
|
|
*/
|
|
|
|
public $deprecated_constants = [];
|
|
|
|
|
2017-11-16 20:47:58 -05:00
|
|
|
/**
|
|
|
|
* @var bool
|
|
|
|
*/
|
|
|
|
public $sealed_properties = false;
|
|
|
|
|
2018-04-22 00:40:30 -04:00
|
|
|
/**
|
|
|
|
* @var bool
|
|
|
|
*/
|
|
|
|
public $sealed_methods = false;
|
|
|
|
|
2018-11-24 18:31:00 -05:00
|
|
|
/**
|
|
|
|
* @var bool
|
|
|
|
*/
|
2018-11-25 11:11:33 -05:00
|
|
|
public $override_property_visibility = false;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var bool
|
|
|
|
*/
|
|
|
|
public $override_method_visibility = false;
|
2018-11-24 18:31:00 -05:00
|
|
|
|
2017-09-13 11:32:13 -04:00
|
|
|
/**
|
|
|
|
* @var array<int, string>
|
|
|
|
*/
|
|
|
|
public $suppressed_issues = [];
|
|
|
|
|
2017-02-09 20:35:17 -05:00
|
|
|
/**
|
|
|
|
* @var string
|
2017-01-02 15:31:18 -05:00
|
|
|
*/
|
2017-02-08 00:28:26 -05:00
|
|
|
public $name;
|
2017-01-02 15:31:18 -05:00
|
|
|
|
2016-12-30 12:41:14 -05:00
|
|
|
/**
|
|
|
|
* Is this class user-defined
|
|
|
|
*
|
|
|
|
* @var bool
|
|
|
|
*/
|
2017-01-18 00:33:48 -05:00
|
|
|
public $user_defined = false;
|
2016-12-30 12:41:14 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Interfaces this class implements
|
|
|
|
*
|
2017-07-25 16:11:02 -04:00
|
|
|
* @var array<string, string>
|
2016-12-30 12:41:14 -05:00
|
|
|
*/
|
|
|
|
public $class_implements = [];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Parent interfaces
|
|
|
|
*
|
2017-07-25 16:11:02 -04:00
|
|
|
* @var array<string, string>
|
2016-12-30 12:41:14 -05:00
|
|
|
*/
|
|
|
|
public $parent_interfaces = [];
|
|
|
|
|
2019-05-25 11:51:09 -04:00
|
|
|
/**
|
|
|
|
* There can only be one direct parent class
|
|
|
|
*
|
|
|
|
* @var ?string
|
|
|
|
*/
|
|
|
|
public $parent_class;
|
|
|
|
|
2017-01-02 15:31:18 -05:00
|
|
|
/**
|
2018-02-19 10:06:35 -08:00
|
|
|
* Parent classes
|
2017-01-02 15:31:18 -05:00
|
|
|
*
|
2018-02-03 18:52:35 -05:00
|
|
|
* @var array<string, string>
|
2017-01-02 15:31:18 -05:00
|
|
|
*/
|
|
|
|
public $parent_classes = [];
|
|
|
|
|
2016-12-30 12:41:14 -05:00
|
|
|
/**
|
2017-02-08 00:28:26 -05:00
|
|
|
* @var CodeLocation|null
|
2016-12-30 12:41:14 -05:00
|
|
|
*/
|
2017-02-08 00:28:26 -05:00
|
|
|
public $location;
|
2017-01-19 23:45:21 -05:00
|
|
|
|
2019-06-01 00:56:54 -04:00
|
|
|
/**
|
|
|
|
* @var CodeLocation|null
|
|
|
|
*/
|
|
|
|
public $stmt_location;
|
|
|
|
|
2017-01-20 00:10:10 -05:00
|
|
|
/**
|
|
|
|
* @var bool
|
|
|
|
*/
|
|
|
|
public $abstract = false;
|
|
|
|
|
2017-11-29 23:46:56 -05:00
|
|
|
/**
|
|
|
|
* @var bool
|
|
|
|
*/
|
|
|
|
public $final = false;
|
|
|
|
|
2016-12-30 12:41:14 -05:00
|
|
|
/**
|
2017-07-25 16:11:02 -04:00
|
|
|
* @var array<string, string>
|
2016-12-30 12:41:14 -05:00
|
|
|
*/
|
|
|
|
public $used_traits = [];
|
2016-12-30 15:53:35 -05:00
|
|
|
|
2017-07-25 16:11:02 -04:00
|
|
|
/**
|
|
|
|
* @var array<string, string>
|
|
|
|
*/
|
|
|
|
public $trait_alias_map = [];
|
|
|
|
|
2019-01-07 11:53:22 -05:00
|
|
|
/**
|
|
|
|
* @var array<string, int>
|
|
|
|
*/
|
|
|
|
public $trait_visibility_map = [];
|
|
|
|
|
2017-06-30 01:24:45 -04:00
|
|
|
/**
|
|
|
|
* @var bool
|
|
|
|
*/
|
|
|
|
public $is_trait = false;
|
|
|
|
|
2018-02-19 00:27:39 -05:00
|
|
|
/**
|
|
|
|
* @var bool
|
|
|
|
*/
|
|
|
|
public $is_interface = false;
|
|
|
|
|
2016-12-30 15:53:35 -05:00
|
|
|
/**
|
|
|
|
* @var array<string, MethodStorage>
|
|
|
|
*/
|
|
|
|
public $methods = [];
|
|
|
|
|
2018-04-21 22:13:10 -04:00
|
|
|
/**
|
2018-11-30 15:13:25 -05:00
|
|
|
* @var array<string, MethodStorage>
|
2018-04-21 22:13:10 -04:00
|
|
|
*/
|
|
|
|
public $pseudo_methods = [];
|
|
|
|
|
2019-01-18 11:37:52 -05:00
|
|
|
/**
|
|
|
|
* @var array<string, MethodStorage>
|
|
|
|
*/
|
|
|
|
public $pseudo_static_methods = [];
|
|
|
|
|
2016-12-30 15:53:35 -05:00
|
|
|
/**
|
|
|
|
* @var array<string, string>
|
|
|
|
*/
|
|
|
|
public $declaring_method_ids = [];
|
|
|
|
|
2016-12-31 11:49:04 -05:00
|
|
|
/**
|
|
|
|
* @var array<string, string>
|
|
|
|
*/
|
|
|
|
public $appearing_method_ids = [];
|
|
|
|
|
2016-12-30 15:53:35 -05:00
|
|
|
/**
|
|
|
|
* @var array<string, array<string>>
|
|
|
|
*/
|
|
|
|
public $overridden_method_ids = [];
|
2017-01-01 19:09:17 -05:00
|
|
|
|
2019-03-25 11:25:43 -04:00
|
|
|
/**
|
|
|
|
* @var array<string, string>
|
|
|
|
*/
|
|
|
|
public $documenting_method_ids = [];
|
|
|
|
|
2018-01-26 11:50:29 -05:00
|
|
|
/**
|
|
|
|
* @var array<string, array<string>>
|
|
|
|
*/
|
|
|
|
public $interface_method_ids = [];
|
|
|
|
|
2017-11-08 21:27:23 -05:00
|
|
|
/**
|
|
|
|
* @var array<string, string>
|
|
|
|
*/
|
|
|
|
public $inheritable_method_ids = [];
|
|
|
|
|
2018-09-25 18:37:24 -04:00
|
|
|
/**
|
|
|
|
* @var array<string, array<string, bool>>
|
|
|
|
*/
|
|
|
|
public $potential_declaring_method_ids = [];
|
|
|
|
|
2017-01-01 19:09:17 -05:00
|
|
|
/**
|
|
|
|
* @var array<string, PropertyStorage>
|
|
|
|
*/
|
|
|
|
public $properties = [];
|
|
|
|
|
2017-05-04 18:35:05 -04:00
|
|
|
/**
|
|
|
|
* @var array<string, Type\Union>
|
|
|
|
*/
|
2017-05-05 11:20:05 -04:00
|
|
|
public $pseudo_property_set_types = [];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var array<string, Type\Union>
|
|
|
|
*/
|
|
|
|
public $pseudo_property_get_types = [];
|
2017-05-04 18:35:05 -04:00
|
|
|
|
2017-01-01 19:09:17 -05:00
|
|
|
/**
|
|
|
|
* @var array<string, string>
|
|
|
|
*/
|
|
|
|
public $declaring_property_ids = [];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var array<string, string>
|
|
|
|
*/
|
|
|
|
public $appearing_property_ids = [];
|
2017-01-19 13:11:45 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @var array<string, string>
|
|
|
|
*/
|
|
|
|
public $inheritable_property_ids = [];
|
2017-02-09 20:35:17 -05:00
|
|
|
|
2018-03-04 12:24:50 -05:00
|
|
|
/**
|
|
|
|
* @var array<string, array<string>>
|
|
|
|
*/
|
|
|
|
public $overridden_property_ids = [];
|
|
|
|
|
2017-02-09 20:35:17 -05:00
|
|
|
/**
|
2019-03-22 15:59:10 -04:00
|
|
|
* @var array<string, array<string, array{Type\Union}>>|null
|
2017-02-09 20:35:17 -05:00
|
|
|
*/
|
|
|
|
public $template_types;
|
2017-02-26 23:09:18 -05:00
|
|
|
|
2019-05-06 16:38:08 -04:00
|
|
|
/**
|
|
|
|
* @var array<int, bool>|null
|
|
|
|
*/
|
|
|
|
public $template_covariants;
|
|
|
|
|
2018-05-28 22:26:43 +01:00
|
|
|
/**
|
2019-03-16 11:15:25 -04:00
|
|
|
* @var array<string, array<int|string, Type\Union>>|null
|
2018-05-28 22:26:43 +01:00
|
|
|
*/
|
2019-01-10 17:58:32 -05:00
|
|
|
public $template_type_extends;
|
|
|
|
|
2019-01-24 17:55:03 -05:00
|
|
|
/**
|
|
|
|
* @var ?int
|
|
|
|
*/
|
|
|
|
public $template_type_extends_count;
|
|
|
|
|
2019-01-27 21:00:27 -05:00
|
|
|
/**
|
2019-01-27 23:12:40 -05:00
|
|
|
* @var array<string, int>|null
|
2019-01-27 21:00:27 -05:00
|
|
|
*/
|
2019-01-27 23:12:40 -05:00
|
|
|
public $template_type_implements_count;
|
2019-01-27 21:00:27 -05:00
|
|
|
|
|
|
|
/**
|
2019-01-27 23:12:40 -05:00
|
|
|
* @var array<string, int>|null
|
2019-01-27 21:00:27 -05:00
|
|
|
*/
|
2019-01-27 23:12:40 -05:00
|
|
|
public $template_type_uses_count;
|
2019-01-27 21:00:27 -05:00
|
|
|
|
2017-12-27 12:27:59 +01:00
|
|
|
/**
|
|
|
|
* @var array<string, bool>
|
|
|
|
*/
|
|
|
|
public $initialized_properties = [];
|
2018-02-14 13:34:16 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @var array<string>
|
|
|
|
*/
|
|
|
|
public $invalid_dependencies = [];
|
2018-02-19 00:27:39 -05:00
|
|
|
|
2019-01-24 15:03:13 -05:00
|
|
|
/**
|
|
|
|
* @var array<string, bool>
|
|
|
|
*/
|
|
|
|
public $dependent_classlikes = [];
|
|
|
|
|
2018-02-19 00:27:39 -05:00
|
|
|
/**
|
|
|
|
* A hash of the source file's name, contents, and this file's modified on date
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
public $hash = '';
|
2018-05-03 11:38:27 -04:00
|
|
|
|
2018-05-29 10:13:26 -04:00
|
|
|
/**
|
|
|
|
* @var bool
|
|
|
|
*/
|
|
|
|
public $has_visitor_issues = false;
|
|
|
|
|
2018-11-01 17:03:08 -04:00
|
|
|
/**
|
|
|
|
* @var bool
|
|
|
|
*/
|
|
|
|
public $has_docblock_issues = false;
|
|
|
|
|
2018-05-03 11:38:27 -04:00
|
|
|
/**
|
|
|
|
* @param string $name
|
|
|
|
*/
|
|
|
|
public function __construct($name)
|
|
|
|
{
|
|
|
|
$this->name = $name;
|
|
|
|
}
|
2016-12-30 12:41:14 -05:00
|
|
|
}
|