Skip to content

Commit 2e343fc

Browse files
committed
Mark PDO::setAttribute() $value as mixed
For consistency with PDOStatement::setAttribute(). Attribute values can for example also be bool. This is backwards-compatible, as mixed is the same as no type for parameter variance.
1 parent 465b3ab commit 2e343fc

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

ext/pdo/pdo_dbh.stub.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@ public function quote(string $string, int $type = PDO::PARAM_STR) {}
4545
/** @return bool */
4646
public function rollBack() {}
4747

48-
/**
49-
* @param array|int $value
50-
* @return bool
51-
*/
52-
public function setAttribute(int $attribute, $value) {}
48+
/** @return bool */
49+
public function setAttribute(int $attribute, mixed $value) {}
5350
}

ext/pdo/pdo_dbh_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: 788d1cd616c140df4072c6e0564c2995fbdc84ad */
2+
* Stub hash: 2952abcfab855d46f6e5fb9dcf447d87f06b6881 */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO___construct, 0, 0, 1)
55
ZEND_ARG_TYPE_INFO(0, dsn, IS_STRING, 0)
@@ -53,7 +53,7 @@ ZEND_END_ARG_INFO()
5353

5454
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO_setAttribute, 0, 0, 2)
5555
ZEND_ARG_TYPE_INFO(0, attribute, IS_LONG, 0)
56-
ZEND_ARG_INFO(0, value)
56+
ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0)
5757
ZEND_END_ARG_INFO()
5858

5959

0 commit comments

Comments
 (0)