diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2020-08-14 15:07:55 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-08-14 15:19:18 +0200 |
commit | cfaa270da5b511e2821aa0a5e036ef5879a56bed (patch) | |
tree | 57600b5a641d427d4d7dc519d1ce28ce807b4e37 /ext/pdo | |
parent | ca20f36b2a89e01c701bb9b3da0db62b28972d7e (diff) | |
download | php-git-cfaa270da5b511e2821aa0a5e036ef5879a56bed.tar.gz |
Use variadic signature for PDOStatement::fetchAll()
The current signature is incorrect, because the $ctor_args parameter
is not required to be an array (it can at least also be null, and
isn't enforced by an exception anyway).
I'm going for the variadic signature here, because we already use
the same variadic signature in PDO::query() and
PDOStatement::setFetchMode(), all of them accepting essentially the
same arguments.
Diffstat (limited to 'ext/pdo')
-rw-r--r-- | ext/pdo/pdo_stmt.stub.php | 7 | ||||
-rw-r--r-- | ext/pdo/pdo_stmt_arginfo.h | 5 |
2 files changed, 4 insertions, 8 deletions
diff --git a/ext/pdo/pdo_stmt.stub.php b/ext/pdo/pdo_stmt.stub.php index c44753387c..d81097c164 100644 --- a/ext/pdo/pdo_stmt.stub.php +++ b/ext/pdo/pdo_stmt.stub.php @@ -34,11 +34,8 @@ class PDOStatement implements IteratorAggregate /** @return mixed */ public function fetch(int $fetch_style = PDO::FETCH_BOTH, int $cursor_orientation = PDO::FETCH_ORI_NEXT, int $cursor_offset = 0) {} - /** - * @param mixed $fetch_argument - * @return array|false - */ - public function fetchAll(int $fetch_style = PDO::FETCH_BOTH, $fetch_argument = UNKNOWN, array $ctor_args = []) {} + /** @return array|false */ + public function fetchAll(int $fetch_style = PDO::FETCH_BOTH, mixed ...$fetch_args) {} /** @return mixed */ public function fetchColumn(int $column_number = 0) {} diff --git a/ext/pdo/pdo_stmt_arginfo.h b/ext/pdo/pdo_stmt_arginfo.h index f0241a3001..a819f6a91e 100644 --- a/ext/pdo/pdo_stmt_arginfo.h +++ b/ext/pdo/pdo_stmt_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: d64c75660cfc44b582e7dcc20c4ce22e8e0848e1 */ + * Stub hash: 45c43e025d9194f2dd7b2ab13d86a4e5f316fa48 */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_bindColumn, 0, 0, 2) ZEND_ARG_TYPE_MASK(0, column, MAY_BE_STRING|MAY_BE_LONG, NULL) @@ -46,8 +46,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_fetchAll, 0, 0, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, fetch_style, IS_LONG, 0, "PDO::FETCH_BOTH") - ZEND_ARG_INFO(0, fetch_argument) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, ctor_args, IS_ARRAY, 0, "[]") + ZEND_ARG_VARIADIC_TYPE_INFO(0, fetch_args, IS_MIXED, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_fetchColumn, 0, 0, 0) |