Skip to content

Review parameter names in ext/sysvmsg #6247

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions ext/sysvmsg/sysvmsg.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,28 @@ final class SysvMessageQueue
{
}

function msg_get_queue(int $key, int $perms = 0666): SysvMessageQueue|false {}
function msg_get_queue(int $key, int $permissions = 0666): SysvMessageQueue|false {}

/**
* @param string|int|float|bool $message
* @param int $errorcode
* @param int $error_code
*/
function msg_send(SysvMessageQueue $queue, int $msgtype, $message, bool $serialize = true, bool $blocking = true, &$errorcode = null): bool {}
function msg_send(SysvMessageQueue $queue, int $message_type, $message, bool $serialize = true, bool $blocking = true, &$error_code = null): bool {}

/**
* @param int $msgtype
* @param int $errorcode
* @param int $received_message_type
* @param int $error_code
*/
function msg_receive(SysvMessageQueue $queue, int $desiredmsgtype, &$msgtype, int $maxsize, mixed &$message, bool $unserialize = true, int $flags = 0, &$errorcode = null): bool {}
function msg_receive(
SysvMessageQueue $queue,
int $desired_message_type,
&$received_message_type,
int $max_message_size,
mixed &$message,
bool $unserialize = true,
int $flags = 0,
&$error_code = null
): bool {}

function msg_remove_queue(SysvMessageQueue $queue): bool {}

Expand Down
16 changes: 8 additions & 8 deletions ext/sysvmsg/sysvmsg_arginfo.h
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 40f03edb33ac213c9f436d5e7ea85ec2750fdf6e */
* Stub hash: 3f918caddccfebee1f1048abd4a23672724436ad */

ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_msg_get_queue, 0, 1, SysvMessageQueue, MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(0, key, IS_LONG, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, perms, IS_LONG, 0, "0666")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, permissions, IS_LONG, 0, "0666")
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_msg_send, 0, 3, _IS_BOOL, 0)
ZEND_ARG_OBJ_INFO(0, queue, SysvMessageQueue, 0)
ZEND_ARG_TYPE_INFO(0, msgtype, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, message_type, IS_LONG, 0)
ZEND_ARG_INFO(0, message)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, serialize, _IS_BOOL, 0, "true")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, blocking, _IS_BOOL, 0, "true")
ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, errorcode, "null")
ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, error_code, "null")
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_msg_receive, 0, 5, _IS_BOOL, 0)
ZEND_ARG_OBJ_INFO(0, queue, SysvMessageQueue, 0)
ZEND_ARG_TYPE_INFO(0, desiredmsgtype, IS_LONG, 0)
ZEND_ARG_INFO(1, msgtype)
ZEND_ARG_TYPE_INFO(0, maxsize, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, desired_message_type, IS_LONG, 0)
ZEND_ARG_INFO(1, received_message_type)
ZEND_ARG_TYPE_INFO(0, max_message_size, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(1, message, IS_MIXED, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, unserialize, _IS_BOOL, 0, "true")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0")
ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, errorcode, "null")
ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, error_code, "null")
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_msg_remove_queue, 0, 1, _IS_BOOL, 0)
Expand Down
4 changes: 2 additions & 2 deletions ext/sysvmsg/tests/005.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ bool(false)
bool(false)
bool(false)
bool(true)
msg_receive(): Argument #4 ($maxsize) must be greater than 0
msg_receive(): Argument #4 ($max_message_size) must be greater than 0

Warning: msg_send(): msgsnd failed: Invalid argument in %s on line %d
bool(false)
Expand All @@ -56,7 +56,7 @@ bool(false)
bool(false)
bool(false)
bool(true)
msg_receive(): Argument #4 ($maxsize) must be greater than 0
msg_receive(): Argument #4 ($max_message_size) must be greater than 0

Warning: msg_send(): msgsnd failed: Invalid argument in %s on line %d
bool(false)
Expand Down