Skip to content

Commit 32b0b47

Browse files
committed
Make fetch argument variadic
1 parent 4631242 commit 32b0b47

File tree

4 files changed

+8
-11
lines changed

4 files changed

+8
-11
lines changed

ext/pdo/pdo_dbh.stub.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function lastInsertId(?string $name = null) {}
3737
public function prepare(string $statement, array $driver_options = []) {}
3838

3939
/** @return PDOStatement|false */
40-
public function query(string $statement, ?int $fetch_mode = null, mixed $arg1 = null, ?array $constructorArguments = []) {}
40+
public function query(string $statement, ?int $fetch_mode = null, mixed ...$fetch_mode_args) {}
4141

4242
/** @return string|false */
4343
public function quote(string $string, int $parameter_type = PDO::PARAM_STR) {}

ext/pdo/pdo_dbh_arginfo.h

Lines changed: 2 additions & 3 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: 1374ebd53913af744634fcbd745f0182d87fff1a */
2+
* Stub hash: 0c7acc78768ad1fb77a09a24ebd4d4e660b350c9 */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO___construct, 0, 0, 1)
55
ZEND_ARG_TYPE_INFO(0, dsn, IS_STRING, 0)
@@ -41,8 +41,7 @@ ZEND_END_ARG_INFO()
4141
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO_query, 0, 0, 1)
4242
ZEND_ARG_TYPE_INFO(0, statement, IS_STRING, 0)
4343
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, fetch_mode, IS_LONG, 1, "null")
44-
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, arg1, IS_MIXED, 0, "null")
45-
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, constructorArguments, IS_ARRAY, 1, "[]")
44+
ZEND_ARG_VARIADIC_TYPE_INFO(0, fetch_mode_args, IS_MIXED, 0)
4645
ZEND_END_ARG_INFO()
4746

4847
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO_quote, 0, 0, 1)

ext/pdo/pdo_stmt.stub.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function execute(?array $input_parameters = null) {}
3535
public function fetch(int $fetch_style = PDO::FETCH_BOTH, int $cursor_orientation = PDO::FETCH_ORI_NEXT, int $cursor_offset = 0) {}
3636

3737
/** @return array */
38-
public function fetchAll(int $fetch_style = PDO::FETCH_BOTH, mixed $arg2 = null, ?array $constructorArguments = []) {}
38+
public function fetchAll(int $fetch_style = PDO::FETCH_BOTH, mixed ...$fetch_mode_args) {}
3939

4040
/** @return mixed */
4141
public function fetchColumn(int $column_number = 0) {}
@@ -59,7 +59,7 @@ public function rowCount() {}
5959
public function setAttribute(int $attribute, mixed $value) {}
6060

6161
/** @return bool */
62-
public function setFetchMode(int $mode, mixed $arg1 = null, ?array $constructorArguments = []) {}
62+
public function setFetchMode(int $mode, mixed ...$fetch_mode_args) {}
6363

6464
public function getIterator(): Iterator {}
6565
}

ext/pdo/pdo_stmt_arginfo.h

Lines changed: 3 additions & 5 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: 12ba83581b1019e2e0c4565e20682b5e83389cae */
2+
* Stub hash: c12bc1c5d1e3dbd8cce67e50c974b20ec5564e67 */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_bindColumn, 0, 0, 2)
55
ZEND_ARG_TYPE_MASK(0, column, MAY_BE_STRING|MAY_BE_LONG, NULL)
@@ -46,8 +46,7 @@ ZEND_END_ARG_INFO()
4646

4747
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_fetchAll, 0, 0, 0)
4848
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, fetch_style, IS_LONG, 0, "PDO::FETCH_BOTH")
49-
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, arg2, IS_MIXED, 0, "null")
50-
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, constructorArguments, IS_ARRAY, 1, "[]")
49+
ZEND_ARG_VARIADIC_TYPE_INFO(0, fetch_mode_args, IS_MIXED, 0)
5150
ZEND_END_ARG_INFO()
5251

5352
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_fetchColumn, 0, 0, 0)
@@ -78,8 +77,7 @@ ZEND_END_ARG_INFO()
7877

7978
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_setFetchMode, 0, 0, 1)
8079
ZEND_ARG_TYPE_INFO(0, mode, IS_LONG, 0)
81-
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, arg1, IS_MIXED, 0, "null")
82-
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, constructorArguments, IS_ARRAY, 1, "[]")
80+
ZEND_ARG_VARIADIC_TYPE_INFO(0, fetch_mode_args, IS_MIXED, 0)
8381
ZEND_END_ARG_INFO()
8482

8583
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_PDOStatement_getIterator, 0, 0, Iterator, 0)

0 commit comments

Comments
 (0)