Skip to content

Commit f9fb67b

Browse files
committed
Sync signatures with Phan's current values
1 parent 46ac008 commit f9fb67b

8 files changed

+1251
-358
lines changed

FunctionSignatureMap.php

+652-300
Large diffs are not rendered by default.

FunctionSignatureMap_php70_delta.php

+209
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,209 @@
1+
<?php // phpcs:ignoreFile
2+
3+
/**
4+
* This contains the information needed to convert the function signatures for php 7.0 to php 5.6 (and vice versa)
5+
*
6+
* This has two sections.
7+
* The 'new' section contains function/method names from FunctionSignatureMap (And alternates, if applicable) that do not exist in php7.0 or have different signatures in php 7.1.
8+
* If they were just updated, the function/method will be present in the 'added' signatures.
9+
* The 'old' signatures contains the signatures that are different in php 7.0.
10+
* Functions are expected to be removed only in major releases of php. (e.g. php 7.0 removed various functions that were deprecated in 5.6)
11+
*
12+
* @see FunctionSignatureMap.php
13+
*
14+
* @phan-file-suppress PhanPluginMixedKeyNoKey (read by Phan when analyzing this file)
15+
*
16+
* TODO: Add some way to warn about functions such as intdiv or IntlChar if they aren't in the configured target_php_version
17+
*/
18+
return [
19+
'new' => [
20+
'Closure::call' => ['', 'to'=>'object', '...parameters='=>''],
21+
'intdiv' => ['int', 'numerator'=>'int', 'divisor'=>'int'],
22+
'IntlChar::charAge' => ['array', 'char'=>'int|string'],
23+
'IntlChar::charDigitValue' => ['int', 'codepoint'=>'mixed'],
24+
'IntlChar::charDirection' => ['int', 'codepoint'=>'mixed'],
25+
'IntlChar::charFromName' => ['?int', 'name'=>'string', 'namechoice='=>'int'],
26+
'IntlChar::charMirror' => ['mixed', 'codepoint'=>'mixed'],
27+
'IntlChar::charName' => ['string', 'char'=>'int|string', 'namechoice='=>'int'],
28+
'IntlChar::charType' => ['int', 'codepoint'=>'mixed'],
29+
'IntlChar::chr' => ['string', 'codepoint'=>'mixed'],
30+
'IntlChar::digit' => ['int|false', 'char'=>'int|string', 'radix='=>'int'],
31+
'IntlChar::enumCharNames' => ['void', 'start'=>'mixed', 'limit'=>'mixed', 'callback'=>'callable', 'nameChoice='=>'int'],
32+
'IntlChar::enumCharTypes' => ['void', 'cb='=>'callable'],
33+
'IntlChar::foldCase' => ['int|string', 'char'=>'int|string', 'options='=>'int'],
34+
'IntlChar::forDigit' => ['int', 'digit'=>'int', 'radix'=>'int'],
35+
'IntlChar::getBidiPairedBracket' => ['mixed', 'codepoint'=>'mixed'],
36+
'IntlChar::getBlockCode' => ['int', 'char'=>'int|string'],
37+
'IntlChar::getCombiningClass' => ['int', 'codepoint'=>'mixed'],
38+
'IntlChar::getFC_NFKC_Closure' => ['string', 'char'=>'int|string'],
39+
'IntlChar::getIntPropertyMaxValue' => ['int', 'property'=>'int'],
40+
'IntlChar::getIntPropertyMinValue' => ['int', 'property'=>'int'],
41+
'IntlChar::getIntPropertyMxValue' => ['int', 'property'=>'int'],
42+
'IntlChar::getIntPropertyValue' => ['int', 'char'=>'int|string', 'property'=>'int'],
43+
'IntlChar::getNumericValue' => ['float', 'char'=>'int|string'],
44+
'IntlChar::getPropertyEnum' => ['int', 'alias'=>'string'],
45+
'IntlChar::getPropertyName' => ['string|false', 'property'=>'int', 'namechoice='=>'int'],
46+
'IntlChar::getPropertyValueEnum' => ['int', 'property'=>'int', 'name'=>'string'],
47+
'IntlChar::getPropertyValueName' => ['string|false', 'prop'=>'int', 'val'=>'int', 'namechoice='=>'int'],
48+
'IntlChar::getUnicodeVersion' => ['array'],
49+
'IntlChar::hasBinaryProperty' => ['bool', 'char'=>'int|string', 'property'=>'int'],
50+
'IntlChar::isalnum' => ['bool', 'codepoint'=>'mixed'],
51+
'IntlChar::isalpha' => ['bool', 'codepoint'=>'mixed'],
52+
'IntlChar::isbase' => ['bool', 'codepoint'=>'mixed'],
53+
'IntlChar::isblank' => ['bool', 'codepoint'=>'mixed'],
54+
'IntlChar::iscntrl' => ['bool', 'codepoint'=>'mixed'],
55+
'IntlChar::isdefined' => ['bool', 'codepoint'=>'mixed'],
56+
'IntlChar::isdigit' => ['bool', 'codepoint'=>'mixed'],
57+
'IntlChar::isgraph' => ['bool', 'codepoint'=>'mixed'],
58+
'IntlChar::isIDIgnorable' => ['bool', 'codepoint'=>'mixed'],
59+
'IntlChar::isIDPart' => ['bool', 'codepoint'=>'mixed'],
60+
'IntlChar::isIDStart' => ['bool', 'codepoint'=>'mixed'],
61+
'IntlChar::isISOControl' => ['bool', 'codepoint'=>'mixed'],
62+
'IntlChar::isJavaIDPart' => ['bool', 'codepoint'=>'mixed'],
63+
'IntlChar::isJavaIDStart' => ['bool', 'codepoint'=>'mixed'],
64+
'IntlChar::isJavaSpaceChar' => ['bool', 'codepoint'=>'mixed'],
65+
'IntlChar::islower' => ['bool', 'codepoint'=>'mixed'],
66+
'IntlChar::isMirrored' => ['bool', 'codepoint'=>'mixed'],
67+
'IntlChar::isprint' => ['bool', 'codepoint'=>'mixed'],
68+
'IntlChar::ispunct' => ['bool', 'codepoint'=>'mixed'],
69+
'IntlChar::isspace' => ['bool', 'codepoint'=>'mixed'],
70+
'IntlChar::istitle' => ['bool', 'codepoint'=>'mixed'],
71+
'IntlChar::isUAlphabetic' => ['bool', 'codepoint'=>'mixed'],
72+
'IntlChar::isULowercase' => ['bool', 'codepoint'=>'mixed'],
73+
'IntlChar::isupper' => ['bool', 'codepoint'=>'mixed'],
74+
'IntlChar::isUUppercase' => ['bool', 'codepoint'=>'mixed'],
75+
'IntlChar::isUWhiteSpace' => ['bool', 'codepoint'=>'mixed'],
76+
'IntlChar::isWhitespace' => ['bool', 'codepoint'=>'mixed'],
77+
'IntlChar::isxdigit' => ['bool', 'codepoint'=>'mixed'],
78+
'IntlChar::ord' => ['int', 'character'=>'mixed'],
79+
'IntlChar::tolower' => ['mixed', 'codepoint'=>'mixed'],
80+
'IntlChar::totitle' => ['mixed', 'codepoint'=>'mixed'],
81+
'IntlChar::toupper' => ['mixed', 'codepoint'=>'mixed'],
82+
'preg_replace_callback_array' => ['string|string[]', 'pattern'=>'array<string,callable(array):string>', 'subject'=>'string|array', 'limit='=>'int', '&w_count='=>'int'],
83+
'random_bytes' => ['string', 'length'=>'int'],
84+
'random_int' => ['int', 'min'=>'int', 'max'=>'int'],
85+
'session_start' => ['bool', 'options='=>'array'],
86+
'unserialize' => ['mixed', 'variable_representation'=>'string', 'allowed_classes='=>'array{allowed_classes?:string[]|bool}'],
87+
],
88+
'old' => [
89+
'ereg' => ['int', 'pattern'=>'string', 'string'=>'string', 'regs='=>'array'],
90+
'ereg_replace' => ['string', 'pattern'=>'string', 'replacement'=>'string', 'string'=>'string'],
91+
'eregi' => ['int', 'pattern'=>'string', 'string'=>'string', 'regs='=>'array'],
92+
'eregi_replace' => ['string', 'pattern'=>'string', 'replacement'=>'string', 'string'=>'string'],
93+
'imagepsbbox' => ['array', 'text'=>'string', 'font'=>'', 'size'=>'int', 'space'=>'int', 'tightness'=>'int', 'angle'=>'float'],
94+
'imagepsencodefont' => ['bool', 'font_index'=>'resource', 'encodingfile'=>'string'],
95+
'imagepsextendfont' => ['bool', 'font_index'=>'resource', 'extend'=>'float'],
96+
'imagepsfreefont' => ['bool', 'font_index'=>'resource'],
97+
'imagepsloadfont' => ['resource', 'filename'=>'string'],
98+
'imagepsslantfont' => ['bool', 'font_index'=>'resource', 'slant'=>'float'],
99+
'imagepstext' => ['array', 'image'=>'resource', 'text'=>'string', 'font_index'=>'resource', 'size'=>'int', 'foreground'=>'int', 'background'=>'int', 'x'=>'int', 'y'=>'int', 'space='=>'int', 'tightness='=>'int', 'angle='=>'float', 'antialias_steps='=>'int'],
100+
'mssql_bind' => ['bool', 'stmt'=>'resource', 'param_name'=>'string', 'var'=>'mixed', 'type'=>'int', 'is_output='=>'bool', 'is_null='=>'bool', 'maxlen='=>'int'],
101+
'mssql_close' => ['bool', 'link_identifier='=>'resource'],
102+
'mssql_connect' => ['resource', 'servername='=>'string', 'username='=>'string', 'password='=>'string', 'new_link='=>'bool'],
103+
'mssql_data_seek' => ['bool', 'result_identifier'=>'resource', 'row_number'=>'int'],
104+
'mssql_execute' => ['mixed', 'stmt'=>'resource', 'skip_results='=>'bool'],
105+
'mssql_fetch_array' => ['array', 'result'=>'resource', 'result_type='=>'int'],
106+
'mssql_fetch_assoc' => ['array', 'result_id'=>'resource'],
107+
'mssql_fetch_batch' => ['int', 'result'=>'resource'],
108+
'mssql_fetch_field' => ['object', 'result'=>'resource', 'field_offset='=>'int'],
109+
'mssql_fetch_object' => ['object', 'result'=>'resource'],
110+
'mssql_fetch_row' => ['array', 'result'=>'resource'],
111+
'mssql_field_length' => ['int', 'result'=>'resource', 'offset='=>'int'],
112+
'mssql_field_name' => ['string', 'result'=>'resource', 'offset='=>'int'],
113+
'mssql_field_seek' => ['bool', 'result'=>'resource', 'field_offset'=>'int'],
114+
'mssql_field_type' => ['string', 'result'=>'resource', 'offset='=>'int'],
115+
'mssql_free_result' => ['bool', 'result'=>'resource'],
116+
'mssql_free_statement' => ['bool', 'stmt'=>'resource'],
117+
'mssql_get_last_message' => ['string'],
118+
'mssql_guid_string' => ['string', 'binary'=>'string', 'short_format='=>'bool'],
119+
'mssql_init' => ['resource', 'sp_name'=>'string', 'link_identifier='=>'resource'],
120+
'mssql_min_error_severity' => ['void', 'severity'=>'int'],
121+
'mssql_min_message_severity' => ['void', 'severity'=>'int'],
122+
'mssql_next_result' => ['bool', 'result_id'=>'resource'],
123+
'mssql_num_fields' => ['int', 'result'=>'resource'],
124+
'mssql_num_rows' => ['int', 'result'=>'resource'],
125+
'mssql_pconnect' => ['resource', 'servername='=>'string', 'username='=>'string', 'password='=>'string', 'new_link='=>'bool'],
126+
'mssql_query' => ['mixed', 'query'=>'string', 'link_identifier='=>'resource', 'batch_size='=>'int'],
127+
'mssql_result' => ['string', 'result'=>'resource', 'row'=>'int', 'field'=>'mixed'],
128+
'mssql_rows_affected' => ['int', 'link_identifier'=>'resource'],
129+
'mssql_select_db' => ['bool', 'database_name'=>'string', 'link_identifier='=>'resource'],
130+
'mysql_affected_rows' => ['int', 'link_identifier='=>'resource'],
131+
'mysql_client_encoding' => ['string', 'link_identifier='=>'resource'],
132+
'mysql_close' => ['bool', 'link_identifier='=>'resource'],
133+
'mysql_connect' => ['resource', 'server='=>'string', 'username='=>'string', 'password='=>'string', 'new_link='=>'bool', 'client_flags='=>'int'],
134+
'mysql_create_db' => ['bool', 'database_name'=>'string', 'link_identifier='=>'resource'],
135+
'mysql_data_seek' => ['bool', 'result'=>'resource', 'row_number'=>'int'],
136+
'mysql_db_name' => ['string', 'result'=>'resource', 'row'=>'int', 'field='=>'mixed'],
137+
'mysql_db_query' => ['resource', 'database'=>'string', 'query'=>'string', 'link_identifier='=>'resource'],
138+
'mysql_drop_db' => ['bool', 'database_name'=>'string', 'link_identifier='=>'resource'],
139+
'mysql_errno' => ['int', 'link_identifier='=>'resource'],
140+
'mysql_error' => ['string', 'link_identifier='=>'resource'],
141+
'mysql_escape_string' => ['string', 'unescaped_string'=>'string'],
142+
'mysql_fetch_array' => ['array', 'result'=>'resource', 'result_type='=>'int'],
143+
'mysql_fetch_assoc' => ['array', 'result'=>'resource'],
144+
'mysql_fetch_field' => ['object', 'result'=>'resource', 'field_offset='=>'int'],
145+
'mysql_fetch_lengths' => ['array', 'result'=>'resource'],
146+
'mysql_fetch_object' => ['object', 'result'=>'resource', 'class_name='=>'string', 'params='=>'array'],
147+
'mysql_fetch_row' => ['array', 'result'=>'resource'],
148+
'mysql_field_flags' => ['string', 'result'=>'resource', 'field_offset'=>'int'],
149+
'mysql_field_len' => ['int', 'result'=>'resource', 'field_offset'=>'int'],
150+
'mysql_field_name' => ['string', 'result'=>'resource', 'field_offset'=>'int'],
151+
'mysql_field_seek' => ['bool', 'result'=>'resource', 'field_offset'=>'int'],
152+
'mysql_field_table' => ['string', 'result'=>'resource', 'field_offset'=>'int'],
153+
'mysql_field_type' => ['string', 'result'=>'resource', 'field_offset'=>'int'],
154+
'mysql_free_result' => ['bool', 'result'=>'resource'],
155+
'mysql_get_client_info' => ['string'],
156+
'mysql_get_host_info' => ['string', 'link_identifier='=>'resource'],
157+
'mysql_get_proto_info' => ['int', 'link_identifier='=>'resource'],
158+
'mysql_get_server_info' => ['string', 'link_identifier='=>'resource'],
159+
'mysql_info' => ['string', 'link_identifier='=>'resource'],
160+
'mysql_insert_id' => ['int', 'link_identifier='=>'resource'],
161+
'mysql_list_dbs' => ['resource', 'link_identifier='=>'resource'],
162+
'mysql_list_fields' => ['resource', 'database_name'=>'string', 'table_name'=>'string', 'link_identifier='=>'resource'],
163+
'mysql_list_processes' => ['resource', 'link_identifier='=>'resource'],
164+
'mysql_list_tables' => ['resource', 'database'=>'string', 'link_identifier='=>'resource'],
165+
'mysql_num_fields' => ['int', 'result'=>'resource'],
166+
'mysql_num_rows' => ['int', 'result'=>'resource'],
167+
'mysql_pconnect' => ['resource', 'server='=>'string', 'username='=>'string', 'password='=>'string', 'client_flags='=>'int'],
168+
'mysql_ping' => ['bool', 'link_identifier='=>'resource'],
169+
'mysql_query' => ['resource', 'query'=>'string', 'link_identifier='=>'resource'],
170+
'mysql_real_escape_string' => ['string', 'unescaped_string'=>'string', 'link_identifier='=>'resource'],
171+
'mysql_result' => ['string', 'result'=>'resource', 'row'=>'int', 'field='=>'mixed'],
172+
'mysql_select_db' => ['bool', 'database_name'=>'string', 'link_identifier='=>'resource'],
173+
'mysql_set_charset' => ['bool', 'charset'=>'string', 'link_identifier='=>'resource'],
174+
'mysql_stat' => ['string', 'link_identifier='=>'resource'],
175+
'mysql_tablename' => ['string', 'result'=>'resource', 'i'=>'int'],
176+
'mysql_thread_id' => ['int', 'link_identifier='=>'resource'],
177+
'mysql_unbuffered_query' => ['resource', 'query'=>'string', 'link_identifier='=>'resource'],
178+
'session_start' => ['bool'],
179+
'split' => ['list<string>', 'pattern'=>'string', 'string'=>'string', 'limit='=>'int'],
180+
'spliti' => ['list<string>', 'pattern'=>'string', 'string'=>'string', 'limit='=>'int'],
181+
'sql_regcase' => ['string', 'string'=>'string'],
182+
'sybase_affected_rows' => ['int', 'link_identifier='=>'resource'],
183+
'sybase_close' => ['bool', 'link_identifier='=>'resource'],
184+
'sybase_connect' => ['resource', 'servername='=>'string', 'username='=>'string', 'password='=>'string', 'charset='=>'string', 'appname='=>'string', 'new='=>'bool'],
185+
'sybase_data_seek' => ['bool', 'result_identifier'=>'resource', 'row_number'=>'int'],
186+
'sybase_deadlock_retry_count' => ['void', 'retry_count'=>'int'],
187+
'sybase_fetch_array' => ['array', 'result'=>'resource'],
188+
'sybase_fetch_assoc' => ['array', 'result'=>'resource'],
189+
'sybase_fetch_field' => ['object', 'result'=>'resource', 'field_offset='=>'int'],
190+
'sybase_fetch_object' => ['object', 'result'=>'resource', 'object='=>'mixed'],
191+
'sybase_fetch_row' => ['array', 'result'=>'resource'],
192+
'sybase_field_seek' => ['bool', 'result'=>'resource', 'field_offset'=>'int'],
193+
'sybase_free_result' => ['bool', 'result'=>'resource'],
194+
'sybase_get_last_message' => ['string'],
195+
'sybase_min_client_severity' => ['void', 'severity'=>'int'],
196+
'sybase_min_error_severity' => ['void', 'severity'=>'int'],
197+
'sybase_min_message_severity' => ['void', 'severity'=>'int'],
198+
'sybase_min_server_severity' => ['void', 'severity'=>'int'],
199+
'sybase_num_fields' => ['int', 'result'=>'resource'],
200+
'sybase_num_rows' => ['int', 'result'=>'resource'],
201+
'sybase_pconnect' => ['resource', 'servername='=>'string', 'username='=>'string', 'password='=>'string', 'charset='=>'string', 'appname='=>'string'],
202+
'sybase_query' => ['mixed', 'query'=>'string', 'link_identifier='=>'resource'],
203+
'sybase_result' => ['string', 'result'=>'resource', 'row'=>'int', 'field'=>'mixed'],
204+
'sybase_select_db' => ['bool', 'database_name'=>'string', 'link_identifier='=>'resource'],
205+
'sybase_set_message_handler' => ['bool', 'handler'=>'callable', 'connection='=>'resource'],
206+
'sybase_unbuffered_query' => ['resource', 'query'=>'string', 'link_identifier'=>'resource', 'store_result='=>'bool'],
207+
'unserialize' => ['mixed', 'variable_representation'=>'string'],
208+
]
209+
];

FunctionSignatureMap_php71_delta.php

+9-9
Original file line numberDiff line numberDiff line change
@@ -20,29 +20,29 @@
2020
'curl_multi_errno' => ['int', 'mh'=>'resource'],
2121
'curl_share_errno' => ['int', 'sh'=>'resource'],
2222
'curl_share_strerror' => ['string', 'code'=>'int'],
23-
'get_headers' => ['array|false', 'url'=>'string', 'format='=>'int', 'context='=>'resource'],
23+
'get_headers' => ['array<int|string,array|string>|false', 'url'=>'string', 'format='=>'int', 'context='=>'resource'],
2424
'getenv\'1' => ['array<string,string>'],
25-
'getopt' => ['array<string,string>|array<string,false>|array<string,array<int,string|false>>', 'options'=>'string', 'longopts='=>'array', '&w_optind='=>'int'],
26-
'hash_hkdf' => ['string', 'algo'=>'string', 'ikm'=>'string', 'length='=>'int', 'info='=>'string', 'salt='=>'string'],
25+
'getopt' => ['array<string,string>|array<string,false>|array<string,list<mixed>>', 'options'=>'string', 'longopts='=>'array', '&w_optind='=>'int'],
26+
'hash_hkdf' => ['string|false', 'algo'=>'string', 'ikm'=>'string', 'length='=>'int', 'info='=>'string', 'salt='=>'string'],
2727
'is_iterable' => ['bool', 'var'=>'mixed'],
28-
'openssl_get_curve_names' => ['array<int,string>'],
28+
'openssl_get_curve_names' => ['list<string>'],
2929
'pcntl_async_signals' => ['bool', 'on='=>'bool'],
3030
'pcntl_signal_get_handler' => ['int|string', 'signo'=>'int'],
31-
'pg_fetch_all' => ['array', 'result'=>'resource', 'result_type='=>'int'],
31+
'pg_fetch_all' => ['array<int,array>|false', 'result'=>'resource', 'result_type='=>'int'],
3232
'pg_last_error' => ['string', 'connection='=>'resource', 'operation='=>'int'],
33-
'pg_select' => ['mixed', 'db'=>'resource', 'table'=>'string', 'ids'=>'array', 'options='=>'int', 'result_type='=>'int'],
33+
'pg_select' => ['string|bool', 'db'=>'resource', 'table'=>'string', 'ids'=>'array', 'options='=>'int', 'result_type='=>'int'],
3434
'sapi_windows_cp_conv' => ['string', 'in_codepage'=>'int|string', 'out_codepage'=>'int|string', 'subject'=>'string'],
3535
'sapi_windows_cp_get' => ['int'],
3636
'sapi_windows_cp_is_utf8' => ['bool'],
3737
'sapi_windows_cp_set' => ['bool', 'code_page'=>'int'],
3838
'session_create_id' => ['string', 'prefix='=>'string'],
39-
'session_gc' => ['int'],
40-
'unpack' => ['array', 'format'=>'string', 'data'=>'string', 'offset='=>'int'],
39+
'session_gc' => ['int|false'],
40+
'unpack' => ['array|false', 'format'=>'string', 'data'=>'string', 'offset='=>'int'],
4141
],
4242
'old' => [
4343
'SQLite3::createFunction' => ['bool', 'name'=>'string', 'callback'=>'callable', 'argument_count='=>'int'],
4444
'get_headers' => ['array|false', 'url'=>'string', 'format='=>'int'],
45-
'getopt' => ['array<string,string>|array<string,false>|array<string,array<int,string|false>>', 'options'=>'string', 'longopts='=>'array'],
45+
'getopt' => ['array<string,string>|array<string,false>|array<string,list<string|false>>', 'options'=>'string', 'longopts='=>'array'],
4646
'pg_fetch_all' => ['array', 'result'=>'resource'],
4747
'pg_last_error' => ['string', 'connection='=>'resource'],
4848
'pg_select' => ['mixed', 'db'=>'resource', 'table'=>'string', 'ids'=>'array', 'options='=>'int'],

0 commit comments

Comments
 (0)