2016-11-13 05:59:31 +01:00
|
|
|
<?php
|
2021-12-15 04:58:32 +01:00
|
|
|
|
2018-11-06 03:57:36 +01:00
|
|
|
namespace Psalm\Internal\Scanner;
|
2016-11-13 05:59:31 +01:00
|
|
|
|
2018-12-02 00:37:49 +01:00
|
|
|
/**
|
|
|
|
* @internal
|
|
|
|
*/
|
2016-11-13 05:59:31 +01:00
|
|
|
class FunctionDocblockComment
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @var string|null
|
|
|
|
*/
|
2021-09-26 23:24:07 +02:00
|
|
|
public $return_type;
|
2016-11-13 05:59:31 +01:00
|
|
|
|
2018-09-14 05:39:24 +02:00
|
|
|
/**
|
|
|
|
* @var string|null
|
|
|
|
*/
|
2021-09-26 23:24:07 +02:00
|
|
|
public $return_type_description;
|
2018-09-14 05:39:24 +02:00
|
|
|
|
2019-06-01 19:02:20 +02:00
|
|
|
/**
|
|
|
|
* @var int|null
|
|
|
|
*/
|
2021-09-26 23:24:07 +02:00
|
|
|
public $return_type_start;
|
2019-06-01 19:02:20 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @var int|null
|
|
|
|
*/
|
2021-09-26 23:24:07 +02:00
|
|
|
public $return_type_end;
|
2019-06-01 19:02:20 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @var int|null
|
|
|
|
*/
|
|
|
|
public $return_type_line_number;
|
|
|
|
|
2016-11-13 05:59:31 +01:00
|
|
|
/**
|
2021-02-24 16:14:04 +01:00
|
|
|
* @var array<
|
|
|
|
* int,
|
|
|
|
* array{
|
|
|
|
* name:string,
|
|
|
|
* type:string,
|
|
|
|
* line_number: int,
|
|
|
|
* start: int,
|
|
|
|
* end: int,
|
|
|
|
* description?: string
|
|
|
|
* }
|
|
|
|
* >
|
2016-11-13 05:59:31 +01:00
|
|
|
*/
|
|
|
|
public $params = [];
|
|
|
|
|
2019-01-19 19:32:43 +01:00
|
|
|
/**
|
|
|
|
* @var array<int, array{name:string, type:string, line_number: int}>
|
|
|
|
*/
|
|
|
|
public $params_out = [];
|
|
|
|
|
2020-07-02 00:10:24 +02:00
|
|
|
/**
|
|
|
|
* @var array{type:string, line_number: int}|null
|
|
|
|
*/
|
|
|
|
public $self_out;
|
|
|
|
|
2020-07-08 21:51:02 +02:00
|
|
|
/**
|
|
|
|
* @var array{type:string, line_number: int}|null
|
|
|
|
*/
|
|
|
|
public $if_this_is;
|
|
|
|
|
2018-06-08 15:31:21 +02:00
|
|
|
/**
|
|
|
|
* @var array<int, array{name:string, type:string, line_number: int}>
|
|
|
|
*/
|
|
|
|
public $globals = [];
|
|
|
|
|
2016-11-13 05:59:31 +01:00
|
|
|
/**
|
|
|
|
* Whether or not the function is deprecated
|
2017-05-27 02:16:18 +02:00
|
|
|
*
|
|
|
|
* @var bool
|
2016-11-13 05:59:31 +01:00
|
|
|
*/
|
|
|
|
public $deprecated = false;
|
|
|
|
|
2019-05-11 16:15:50 +02:00
|
|
|
/**
|
2019-05-11 19:56:55 +02:00
|
|
|
* If set, the function is internal to the given namespace.
|
2019-05-11 16:15:50 +02:00
|
|
|
*
|
|
|
|
* @var null|string
|
|
|
|
*/
|
2021-09-26 23:24:07 +02:00
|
|
|
public $psalm_internal;
|
2019-05-11 16:15:50 +02:00
|
|
|
|
2018-12-02 00:37:49 +01:00
|
|
|
/**
|
|
|
|
* Whether or not the function is internal
|
|
|
|
*
|
|
|
|
* @var bool
|
|
|
|
*/
|
|
|
|
public $internal = false;
|
|
|
|
|
2016-11-13 05:59:31 +01:00
|
|
|
/**
|
|
|
|
* Whether or not the function uses get_args
|
|
|
|
*
|
2017-05-27 02:16:18 +02:00
|
|
|
* @var bool
|
2016-11-13 05:59:31 +01:00
|
|
|
*/
|
|
|
|
public $variadic = false;
|
|
|
|
|
2019-07-18 07:31:48 +02:00
|
|
|
/**
|
|
|
|
* Whether or not the function is pure
|
|
|
|
*
|
|
|
|
* @var bool
|
|
|
|
*/
|
|
|
|
public $pure = false;
|
|
|
|
|
2020-05-22 04:47:58 +02:00
|
|
|
/**
|
|
|
|
* Whether or not to specialize a given call (useful for taint analysis)
|
|
|
|
*
|
|
|
|
* @var bool
|
|
|
|
*/
|
|
|
|
public $specialize_call = false;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Represents the flow from function params to return type
|
|
|
|
*
|
2020-06-22 23:53:03 +02:00
|
|
|
* @var array<string>
|
2020-05-22 04:47:58 +02:00
|
|
|
*/
|
2020-06-22 23:53:03 +02:00
|
|
|
public $flows = [];
|
2020-05-22 04:47:58 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @var array<string>
|
|
|
|
*/
|
|
|
|
public $added_taints = [];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var array<string>
|
|
|
|
*/
|
|
|
|
public $removed_taints = [];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var array<int, array{name:string, taint: string}>
|
|
|
|
*/
|
|
|
|
public $taint_sink_params = [];
|
|
|
|
|
2020-06-21 06:58:56 +02:00
|
|
|
/**
|
|
|
|
* @var array<string>
|
|
|
|
*/
|
|
|
|
public $taint_source_types = [];
|
|
|
|
|
2020-05-22 04:47:58 +02:00
|
|
|
/**
|
|
|
|
* @var array<int, array{name:string}>
|
|
|
|
*/
|
|
|
|
public $assert_untainted_params = [];
|
|
|
|
|
2017-05-10 18:36:11 +02:00
|
|
|
/**
|
|
|
|
* Whether or not to ignore the nullability of this function's return type
|
|
|
|
*
|
2017-05-27 02:16:18 +02:00
|
|
|
* @var bool
|
2017-05-10 18:36:11 +02:00
|
|
|
*/
|
|
|
|
public $ignore_nullable_return = false;
|
|
|
|
|
2018-01-25 00:52:58 +01:00
|
|
|
/**
|
|
|
|
* Whether or not to ignore the nullability of this function's return type
|
|
|
|
*
|
|
|
|
* @var bool
|
|
|
|
*/
|
|
|
|
public $ignore_falsable_return = false;
|
|
|
|
|
2016-11-13 05:59:31 +01:00
|
|
|
/**
|
2017-01-02 07:07:44 +01:00
|
|
|
* @var array<int, string>
|
2016-11-13 05:59:31 +01:00
|
|
|
*/
|
2019-08-18 18:25:48 +02:00
|
|
|
public $suppressed_issues = [];
|
2016-12-04 01:11:30 +01:00
|
|
|
|
2018-06-22 07:13:49 +02:00
|
|
|
/**
|
2019-08-13 21:44:18 +02:00
|
|
|
* @var array<int, array{0: string, 1: int, 2: int}>
|
2018-06-22 07:13:49 +02:00
|
|
|
*/
|
|
|
|
public $throws = [];
|
|
|
|
|
2017-02-10 02:35:17 +01:00
|
|
|
/**
|
2019-05-06 22:38:08 +02:00
|
|
|
* @var array<int, array{string, ?string, ?string, bool}>
|
2017-02-10 02:35:17 +01:00
|
|
|
*/
|
2018-12-18 05:29:27 +01:00
|
|
|
public $templates = [];
|
2017-02-10 02:35:17 +01:00
|
|
|
|
2018-05-28 21:07:42 +02:00
|
|
|
/**
|
|
|
|
* @var array<int, array{type: string, param_name: string}>
|
|
|
|
*/
|
|
|
|
public $assertions = [];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var array<int, array{type: string, param_name: string}>
|
|
|
|
*/
|
|
|
|
public $if_true_assertions = [];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var array<int, array{type: string, param_name: string}>
|
|
|
|
*/
|
|
|
|
public $if_false_assertions = [];
|
2018-12-21 17:01:24 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @var bool
|
|
|
|
*/
|
|
|
|
public $inheritdoc = false;
|
2019-08-30 18:36:35 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @var bool
|
|
|
|
*/
|
|
|
|
public $mutation_free = false;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var bool
|
|
|
|
*/
|
|
|
|
public $external_mutation_free = false;
|
2020-08-10 15:58:43 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @var bool
|
|
|
|
*/
|
2020-08-14 06:27:33 +02:00
|
|
|
public $no_named_args = false;
|
2020-09-13 22:40:31 +02:00
|
|
|
|
|
|
|
/** @var bool */
|
|
|
|
public $stub_override = false;
|
2020-10-30 22:37:16 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @var int
|
|
|
|
*/
|
|
|
|
public $since_php_major_version = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var int
|
|
|
|
*/
|
|
|
|
public $since_php_minor_version = 0;
|
2021-02-24 16:14:04 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @var ?string
|
|
|
|
*/
|
|
|
|
public $description;
|
2021-05-28 15:47:39 +02:00
|
|
|
|
|
|
|
/** @var array<string, array{lines:list<int>, suggested_replacement?:string}> */
|
|
|
|
public $unexpected_tags = [];
|
2016-11-13 05:59:31 +01:00
|
|
|
}
|