Skip to content

Commit 6f65637

Browse files
authored
Merge pull request #51 from phansys/row_number
Update allowed type and default value for the `$row_number` parameter in several "fetch" functions
2 parents f3b1676 + 07ff9a5 commit 6f65637

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

ibm_db2.stub.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -268,27 +268,27 @@ function db2_result($stmt, int|string $column): mixed|null {}
268268
/**
269269
* @param resource $stmt
270270
*/
271-
function db2_fetch_row($stmt, ?int $row_number = null): bool {}
271+
function db2_fetch_row($stmt, int $row_number = UNKNOWN): bool {}
272272

273273
/**
274274
* @param resource $stmt
275275
*/
276-
function db2_fetch_assoc($stmt, ?int $row_number = null): array|false {}
276+
function db2_fetch_assoc($stmt, int $row_number = -1): array|false {}
277277

278278
/**
279279
* @param resource $stmt
280280
*/
281-
function db2_fetch_array($stmt, ?int $row_number = null): array|false {}
281+
function db2_fetch_array($stmt, int $row_number = -1): array|false {}
282282

283283
/**
284284
* @param resource $stmt
285285
*/
286-
function db2_fetch_both($stmt, ?int $row_number = null): array|false {}
286+
function db2_fetch_both($stmt, int $row_number = -1): array|false {}
287287

288288
/**
289289
* @param resource $stmt
290290
*/
291-
function db2_fetch_object($stmt, ?int $row_number = null): \stdClass|false {}
291+
function db2_fetch_object($stmt, int $row_number = -1): \stdClass|false {}
292292

293293
/**
294294
* @param resource $stmt

ibm_db2_arginfo.h

Lines changed: 4 additions & 4 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: 0e66cf0b41d69fa0aa1514436de097e2b9d53adf */
2+
* Stub hash: 2918ff411a4be42877599d8e5e2ea6c808c46803 */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_db2_connect, 0, 0, 3)
55
ZEND_ARG_TYPE_INFO(0, database, IS_STRING, 0)
@@ -193,12 +193,12 @@ ZEND_END_ARG_INFO()
193193

194194
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_db2_fetch_row, 0, 1, _IS_BOOL, 0)
195195
ZEND_ARG_INFO(0, stmt)
196-
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, row_number, IS_LONG, 1, "null")
196+
ZEND_ARG_TYPE_INFO(0, row_number, IS_LONG, 0)
197197
ZEND_END_ARG_INFO()
198198

199199
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_db2_fetch_assoc, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE)
200200
ZEND_ARG_INFO(0, stmt)
201-
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, row_number, IS_LONG, 1, "null")
201+
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, row_number, IS_LONG, 0, "-1")
202202
ZEND_END_ARG_INFO()
203203

204204
#define arginfo_db2_fetch_array arginfo_db2_fetch_assoc
@@ -207,7 +207,7 @@ ZEND_END_ARG_INFO()
207207

208208
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_db2_fetch_object, 0, 1, stdClass, MAY_BE_FALSE)
209209
ZEND_ARG_INFO(0, stmt)
210-
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, row_number, IS_LONG, 1, "null")
210+
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, row_number, IS_LONG, 0, "-1")
211211
ZEND_END_ARG_INFO()
212212

213213
#define arginfo_db2_free_result arginfo_db2_free_stmt

ibm_db2_legacy_arginfo.h

Lines changed: 1 addition & 1 deletion
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: 0e66cf0b41d69fa0aa1514436de097e2b9d53adf */
2+
* Stub hash: 2918ff411a4be42877599d8e5e2ea6c808c46803 */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_db2_connect, 0, 0, 3)
55
ZEND_ARG_INFO(0, database)

0 commit comments

Comments
 (0)