Skip to content

Commit df6c7b8

Browse files
committed
fixup! Add stubs for standard library
Fix stubs
1 parent 9efd9cc commit df6c7b8

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

ext/standard/basic_functions.stub.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1193,7 +1193,7 @@ function stream_context_get_params($context): array {}
11931193
* @param array|string $param2
11941194
* @param mixed $value
11951195
*/
1196-
function stream_context_set_option($context, $param2, string $option_name = UNDEFINED, $value = UNDEFINED): bool {}
1196+
function stream_context_set_option($context, $param2, string $option_name = UNKNOWN, $value = UNKNWOWN): bool {}
11971197

11981198
/** @param resource $stream_or_context */
11991199
function stream_context_get_options($stream_or_context): array {}
@@ -1207,14 +1207,14 @@ function stream_context_set_default(array $options) {}
12071207
/**
12081208
* @param resource $stream
12091209
* @param mixed $params
1210-
* @return resource
1210+
* @return resource|false
12111211
*/
12121212
function stream_filter_prepend($stream, string $filtername, int $read_write = 0, $params = UNKNOWN) {}
12131213

12141214
/**
12151215
* @param resource $stream
12161216
* @param mixed $params
1217-
* @return resource
1217+
* @return resource|false
12181218
*/
12191219
function stream_filter_append($stream, string $filtername, int $read_write = 0, $params = UNKNOWN) {}
12201220

@@ -1225,13 +1225,13 @@ function stream_filter_remove($stream_filter): bool {}
12251225
* @param resource $context
12261226
* @return resource|false
12271227
*/
1228-
function stream_socket_client(string $remote_socket, &$errno = null, &$errstr = null, float $timeout = UNKNOWN, int $flags = UNKNOWN, $context = null) {}
1228+
function stream_socket_client(string $remote_socket, &$errno = null, &$errstr = null, float $timeout = STREAM_CLIENT_CONNECT, int $flags = UNKNOWN, $context = null) {}
12291229

12301230
/**
12311231
* @param resource $context
12321232
* @return resource|false
12331233
*/
1234-
function stream_socket_server(string $local_socket, &$errno = null, &$errstr = null, int $flags = UNKNOWN, $context = null) {}
1234+
function stream_socket_server(string $local_socket, &$errno = null, &$errstr = null, int $flags = STREAM_SERVER_BIND | STREAM_SERVER_LISTEN, $context = null) {}
12351235

12361236
/**
12371237
* @param resource $server_socket
@@ -1247,7 +1247,7 @@ function stream_socket_get_name($handle, bool $want_peer): string|false {}
12471247
function stream_socket_recvfrom($socket, int $length, int $flags = 0, &$address = null): string|false {}
12481248

12491249
/** @param resource $socket */
1250-
function stream_socket_sendto($socket, string $data, int $flags = 0, $address = null): int|false {}
1250+
function stream_socket_sendto($socket, string $data, int $flags = 0, string $address = ""): int|false {}
12511251

12521252
/**
12531253
* @param resource $stream
@@ -1271,7 +1271,7 @@ function stream_socket_pair(int $domain, int $type, int $protocol): array|false
12711271
function stream_copy_to_stream($source, $dest, int $maxlength = UNKNOWN, int $position = 0): int|false {}
12721272

12731273
/** @param resource $handle */
1274-
function stream_get_contents($handle, int $maxlength = UNKNOWN, int $position = 0): string|false {}
1274+
function stream_get_contents($handle, int $maxlength = UNKNOWN, int $position = -1): string|false {}
12751275

12761276
/** @param resource $stream */
12771277
function stream_supports_lock($stream): bool {}

ext/standard/basic_functions_arginfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1912,7 +1912,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_stream_socket_sendto, 0, 2, MAY_
19121912
ZEND_ARG_INFO(0, socket)
19131913
ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0)
19141914
ZEND_ARG_TYPE_INFO(0, flags, IS_LONG, 0)
1915-
ZEND_ARG_INFO(0, address)
1915+
ZEND_ARG_TYPE_INFO(0, address, IS_STRING, 0)
19161916
ZEND_END_ARG_INFO()
19171917

19181918
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_stream_socket_enable_crypto, 0, 2, MAY_BE_LONG|MAY_BE_BOOL)

0 commit comments

Comments
 (0)