Fix PHP f* files functions signatures (#246964)

For f* files functions signatures :
- Fix signatures param names
- Add fdatasyn(), fsync()
- Add return union type
This commit is contained in:
sfaut
2025-04-20 01:43:42 +02:00
committed by GitHub
parent 87fa98c6a7
commit 47a31406a9

View File

@@ -1664,31 +1664,35 @@ export const globalfunctions: IEntries = {
},
fclose: {
description: 'Closes an open file pointer',
signature: '( resource $handle ): bool'
signature: '( resource $stream ): bool'
},
fdatasync: {
description: 'Synchronizes data (but not meta-data) to the file',
signature: '( resource $stream ): bool'
},
feof: {
description: 'Tests for end-of-file on a file pointer',
signature: '( resource $handle ): bool'
signature: '( resource $stream ): bool'
},
fflush: {
description: 'Flushes the output to a file',
signature: '( resource $handle ): bool'
signature: '( resource $stream ): bool'
},
fgetc: {
description: 'Gets character from file pointer',
signature: '( resource $handle ): string'
signature: '( resource $string ): string|false'
},
fgetcsv: {
description: 'Gets line from file pointer and parse for CSV fields',
signature: '( resource $handle [, int $length = 0 [, string $delimiter = "," [, string $enclosure = \'"\' [, string $escape = "\\" ]]]]): array'
signature: '( resource $stream [, ?int $length = null [, string $separator = "," [, string $enclosure = \'"\' [, string $escape = "\\" ]]]]): array|false'
},
fgets: {
description: 'Gets line from file pointer',
signature: '( resource $handle [, int $length ]): string'
signature: '( resource $stream [, ?int $length = null ]): string|false'
},
fgetss: {
description: 'Gets line from file pointer and strip HTML tags',
signature: '( resource $handle [, int $length [, string $allowable_tags ]]): string'
signature: '( resource $handle [, int $length = ? [, string $allowable_tags = ? ]]): string'
},
file_exists: {
description: 'Checks whether a file or directory exists',
@@ -1696,102 +1700,106 @@ export const globalfunctions: IEntries = {
},
file_get_contents: {
description: 'Reads entire file into a string',
signature: '( string $filename [, bool $use_include_path [, resource $context [, int $offset = 0 [, int $maxlen ]]]]): string'
signature: '( string $filename [, bool $use_include_path = false [, ?resource $context = null [, int $offset = 0 [, ?int $maxlen = null ]]]]): string|false'
},
file_put_contents: {
description: 'Write data to a file',
signature: '( string $filename , mixed $data [, int $flags = 0 [, resource $context ]]): int'
signature: '( string $filename , mixed $data [, int $flags = 0 [, ?resource $context = null ]]): int|false'
},
file: {
description: 'Reads entire file into an array',
signature: '( string $filename [, int $flags = 0 [, resource $context ]]): array'
signature: '( string $filename [, int $flags = 0 [, ?resource $context = null ]]): array|false'
},
fileatime: {
description: 'Gets last access time of file',
signature: '( string $filename ): int'
signature: '( string $filename ): int|false'
},
filectime: {
description: 'Gets inode change time of file',
signature: '( string $filename ): int'
signature: '( string $filename ): int|false'
},
filegroup: {
description: 'Gets file group',
signature: '( string $filename ): int'
signature: '( string $filename ): int|false'
},
fileinode: {
description: 'Gets file inode',
signature: '( string $filename ): int'
signature: '( string $filename ): int|false'
},
filemtime: {
description: 'Gets file modification time',
signature: '( string $filename ): int'
signature: '( string $filename ): int|false'
},
fileowner: {
description: 'Gets file owner',
signature: '( string $filename ): int'
signature: '( string $filename ): int|false'
},
fileperms: {
description: 'Gets file permissions',
signature: '( string $filename ): int'
signature: '( string $filename ): int|false'
},
filesize: {
description: 'Gets file size',
signature: '( string $filename ): int'
signature: '( string $filename ): int|false'
},
filetype: {
description: 'Gets file type',
signature: '( string $filename ): string'
signature: '( string $filename ): string|false'
},
flock: {
description: 'Portable advisory file locking',
signature: '( resource $handle , int $operation [, int $wouldblock ]): bool'
signature: '( resource $stream , int $operation [, int &$would_block = null ]): bool'
},
fnmatch: {
description: 'Match filename against a pattern',
signature: '( string $pattern , string $string [, int $flags = 0 ]): bool'
signature: '( string $pattern , string $filename [, int $flags = 0 ]): bool'
},
fopen: {
description: 'Opens file or URL',
signature: '( string $filename , string $mode [, bool $use_include_path [, resource $context ]]): resource'
signature: '( string $filename , string $mode [, bool $use_include_path = false [, ?resource $context = null ]]): resource|false'
},
fpassthru: {
description: 'Output all remaining data on a file pointer',
signature: '( resource $handle ): int'
signature: '( resource $stream ): int'
},
fputcsv: {
description: 'Format line as CSV and write to file pointer',
signature: '( resource $handle , array $fields [, string $delimiter = "," [, string $enclosure = \'"\' [, string $escape_char = "\\" ]]]): int'
signature: '( resource $stream , array $fields [, string $separator = "," [, string $enclosure = \'"\' [, string $escape = "\\" [, string $eol = "\n" ]]]]): int|false'
},
fputs: {
description: 'Alias of fwrite',
},
fread: {
description: 'Binary-safe file read',
signature: '( resource $handle , int $length ): string'
signature: '( resource $stream , int $length ): string|false'
},
fscanf: {
description: 'Parses input from a file according to a format',
signature: '( resource $handle , string $format [, mixed $... ]): mixed'
signature: '( resource $stream , string $format [, mixed &...$vars ]): array|int|false|null'
},
fseek: {
description: 'Seeks on a file pointer',
signature: '( resource $handle , int $offset [, int $whence = SEEK_SET ]): int'
signature: '( resource $stream , int $offset [, int $whence = SEEK_SET ]): int'
},
fstat: {
description: 'Gets information about a file using an open file pointer',
signature: '( resource $handle ): array'
signature: '( resource $stream ): array|false'
},
fsync: {
description: 'Synchronizes changes to the file (including meta-data)',
signature: '( resource $stream ): bool'
},
ftell: {
description: 'Returns the current position of the file read/write pointer',
signature: '( resource $handle ): int'
signature: '( resource $stream ): int|false'
},
ftruncate: {
description: 'Truncates a file to a given length',
signature: '( resource $handle , int $size ): bool'
signature: '( resource $stream , int $size ): bool'
},
fwrite: {
description: 'Binary-safe file write',
signature: '( resource $handle , string $string [, int $length ]): int'
signature: '( resource $stream , string $data [, ?int $length = null ]): int|false'
},
glob: {
description: 'Find pathnames matching a pattern',