1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-10 23:18:40 +01:00
psalm/src/Psalm/Internal/Scanner/FunctionDocblockComment.php

181 lines
3.8 KiB
PHP
Raw Normal View History

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