Skip to content

Commit 44a246a

Browse files
committed
Fix mysqlii_connect() and mysqli::connect() return types
1 parent 830ba18 commit 44a246a

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

ext/mysqli/mysqli.stub.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public function connect(
110110
?string $database = null,
111111
?int $port = null,
112112
?string $socket = null
113-
): mysqli|null|false {}
113+
): bool {}
114114

115115
/**
116116
* @tentative-return-type

ext/mysqli/mysqli_arginfo.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 73b906f2a452b846a81f535ad01819e600e45836 */
2+
* Stub hash: c9f340f48c4414f1b0cfa48ac9b7167a0a6991ef */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mysqli_affected_rows, 0, 1, MAY_BE_LONG|MAY_BE_STRING)
55
ZEND_ARG_OBJ_INFO(0, mysql, mysqli, 0)
@@ -454,7 +454,7 @@ ZEND_END_ARG_INFO()
454454

455455
#define arginfo_class_mysqli_commit arginfo_class_mysqli_begin_transaction
456456

457-
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_mysqli_connect, 0, 0, mysqli, MAY_BE_NULL|MAY_BE_FALSE)
457+
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_mysqli_connect, 0, 0, _IS_BOOL, 0)
458458
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, hostname, IS_STRING, 1, "null")
459459
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, username, IS_STRING, 1, "null")
460460
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, password, IS_STRING, 1, "null")

ext/mysqli/mysqli_nonapi.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -361,11 +361,8 @@ void mysqli_common_connect(INTERNAL_FUNCTION_PARAMETERS, bool is_real_connect, b
361361
ZEND_ASSERT(instanceof_function(Z_OBJCE_P(object), mysqli_link_class_entry));
362362
(Z_MYSQLI_P(object))->ptr = mysqli_resource;
363363
}
364-
if (!is_real_connect) {
365-
return;
366-
} else {
367-
RETURN_TRUE;
368-
}
364+
365+
RETURN_TRUE;
369366

370367
err:
371368
if (mysql->hash_key) {

0 commit comments

Comments
 (0)