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