Skip to content

Commit 286b2c7

Browse files
staabmondrejmirtes
authored andcommitted
use more precise types in file IO functions
Update resources/functionMap.php
1 parent 1f63ad0 commit 286b2c7

1 file changed

Lines changed: 15 additions & 15 deletions

File tree

resources/functionMap.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2937,13 +2937,13 @@
29372937
'ffmpeg_movie::hasAudio' => ['bool'],
29382938
'ffmpeg_movie::hasVideo' => ['bool'],
29392939
'fgetc' => ['string|false', 'fp'=>'resource'],
2940-
'fgetcsv' => ['(?array)|(?false)', 'fp'=>'resource', 'length='=>'int', 'delimiter='=>'string', 'enclosure='=>'string', 'escape='=>'string'],
2941-
'fgets' => ['string|false', 'fp'=>'resource', 'length='=>'int'],
2942-
'fgetss' => ['string|false', 'fp'=>'resource', 'length='=>'int', 'allowable_tags='=>'string'],
2940+
'fgetcsv' => ['(?array)|(?false)', 'fp'=>'resource', 'length='=>'0|positive-int', 'delimiter='=>'string', 'enclosure='=>'string', 'escape='=>'string'],
2941+
'fgets' => ['string|false', 'fp'=>'resource', 'length='=>'0|positive-int'],
2942+
'fgetss' => ['string|false', 'fp'=>'resource', 'length='=>'0|positive-int', 'allowable_tags='=>'string'],
29432943
'file' => ['array<int,string>|false', 'filename'=>'string', 'flags='=>'int', 'context='=>'resource'],
29442944
'file_exists' => ['bool', 'filename'=>'string'],
2945-
'file_get_contents' => ['string|false', 'filename'=>'string', 'use_include_path='=>'bool', 'context='=>'?resource', 'offset='=>'int', 'maxlen='=>'int'],
2946-
'file_put_contents' => ['int|false', 'file'=>'string', 'data'=>'mixed', 'flags='=>'int', 'context='=>'?resource'],
2945+
'file_get_contents' => ['string|false', 'filename'=>'string', 'use_include_path='=>'bool', 'context='=>'?resource', 'offset='=>'int', 'maxlen='=>'0|positive-int'],
2946+
'file_put_contents' => ['0|positive-int|false', 'file'=>'string', 'data'=>'mixed', 'flags='=>'int', 'context='=>'?resource'],
29472947
'fileatime' => ['int|false', 'filename'=>'string'],
29482948
'filectime' => ['int|false', 'filename'=>'string'],
29492949
'filegroup' => ['int|false', 'filename'=>'string'],
@@ -2958,7 +2958,7 @@
29582958
'filepro_fieldwidth' => ['int', 'field_number'=>'int'],
29592959
'filepro_retrieve' => ['string', 'row_number'=>'int', 'field_number'=>'int'],
29602960
'filepro_rowcount' => ['int'],
2961-
'filesize' => ['int|false', 'filename'=>'string'],
2961+
'filesize' => ['0|positive-int|false', 'filename'=>'string'],
29622962
'FilesystemIterator::__construct' => ['void', 'path'=>'string', 'flags='=>'int'],
29632963
'FilesystemIterator::current' => ['string|SplFileInfo'],
29642964
'FilesystemIterator::getFlags' => ['int'],
@@ -3001,16 +3001,16 @@
30013001
'fopen' => ['resource|false', 'filename'=>'string', 'mode'=>'string', 'use_include_path='=>'bool', 'context='=>'resource'],
30023002
'forward_static_call' => ['mixed', 'function'=>'callable', '...parameters='=>'mixed'],
30033003
'forward_static_call_array' => ['mixed', 'function'=>'callable', 'parameters'=>'array<int,mixed>'],
3004-
'fpassthru' => ['int|false', 'fp'=>'resource'],
3004+
'fpassthru' => ['0|positive-int|false', 'fp'=>'resource'],
30053005
'fpm_get_status' => ['array|false'],
30063006
'fprintf' => ['int', 'stream'=>'resource', 'format'=>'string', '...values='=>'string|int|float'],
3007-
'fputcsv' => ['int|false', 'fp'=>'resource', 'fields'=>'array', 'delimiter='=>'string', 'enclosure='=>'string', 'escape_char='=>'string'],
3008-
'fputs' => ['int|false', 'fp'=>'resource', 'str'=>'string', 'length='=>'int'],
3009-
'fread' => ['string|false', 'fp'=>'resource', 'length'=>'int'],
3007+
'fputcsv' => ['0|positive-int|false', 'fp'=>'resource', 'fields'=>'array', 'delimiter='=>'string', 'enclosure='=>'string', 'escape_char='=>'string'],
3008+
'fputs' => ['0|positive-int|false', 'fp'=>'resource', 'str'=>'string', 'length='=>'0|positive-int'],
3009+
'fread' => ['string|false', 'fp'=>'resource', 'length'=>'0|positive-int'],
30103010
'frenchtojd' => ['int', 'month'=>'int', 'day'=>'int', 'year'=>'int'],
30113011
'fribidi_log2vis' => ['string', 'str'=>'string', 'direction'=>'string', 'charset'=>'int'],
30123012
'fscanf' => ['array|int|false', 'stream'=>'resource', 'format'=>'string', '&...w_vars='=>'string|int|float|null'],
3013-
'fseek' => ['int', 'fp'=>'resource', 'offset'=>'int', 'whence='=>'int'],
3013+
'fseek' => ['0|-1', 'fp'=>'resource', 'offset'=>'int', 'whence='=>'int'],
30143014
'fsockopen' => ['resource|false', 'hostname'=>'string', 'port='=>'int', '&w_errno='=>'int', '&w_errstr='=>'string', 'timeout='=>'float'],
30153015
'fstat' => ['array|false', 'fp'=>'resource'],
30163016
'ftell' => ['int|false', 'fp'=>'resource'],
@@ -3050,12 +3050,12 @@
30503050
'ftp_size' => ['int', 'stream'=>'resource', 'filename'=>'string'],
30513051
'ftp_ssl_connect' => ['resource|false', 'host'=>'string', 'port='=>'int', 'timeout='=>'int'],
30523052
'ftp_systype' => ['string|false', 'stream'=>'resource'],
3053-
'ftruncate' => ['bool', 'fp'=>'resource', 'size'=>'int'],
3053+
'ftruncate' => ['bool', 'fp'=>'resource', 'size'=>'0|positive-int'],
30543054
'func_get_arg' => ['mixed', 'arg_num'=>'0|positive-int'],
30553055
'func_get_args' => ['array'],
30563056
'func_num_args' => ['0|positive-int'],
30573057
'function_exists' => ['bool', 'function_name'=>'string'],
3058-
'fwrite' => ['int|false', 'fp'=>'resource', 'str'=>'string', 'length='=>'int'],
3058+
'fwrite' => ['0|positive-int|false', 'fp'=>'resource', 'str'=>'string', 'length='=>'0|positive-int'],
30593059
'gc_collect_cycles' => ['int'],
30603060
'gc_disable' => ['void'],
30613061
'gc_enable' => ['void'],
@@ -9123,8 +9123,8 @@
91239123
'rawurlencode' => ['string', 'str'=>'string'],
91249124
'read_exif_data' => ['array', 'filename'=>'string|resource', 'sections_needed='=>'string', 'sub_arrays='=>'bool', 'read_thumbnail='=>'bool'],
91259125
'readdir' => ['string|false', 'dir_handle='=>'resource'],
9126-
'readfile' => ['int|false', 'filename'=>'string', 'use_include_path='=>'bool', 'context='=>'resource'],
9127-
'readgzfile' => ['int|false', 'filename'=>'string', 'use_include_path='=>'int'],
9126+
'readfile' => ['0|positive-int|false', 'filename'=>'string', 'use_include_path='=>'bool', 'context='=>'resource'],
9127+
'readgzfile' => ['0|positive-int|false', 'filename'=>'string', 'use_include_path='=>'int'],
91289128
'readline' => ['string|false', 'prompt='=>'?string'],
91299129
'readline_add_history' => ['bool', 'prompt'=>'string'],
91309130
'readline_callback_handler_install' => ['bool', 'prompt'=>'string', 'callback'=>'callable'],

0 commit comments

Comments
 (0)