Skip to content

Commit

Permalink
Mark PDO::setAttribute() $value as mixed
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nikic committed Aug 20, 2021
1 parent 465b3ab commit 2e343fc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
7 changes: 2 additions & 5 deletions ext/pdo/pdo_dbh.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@ public function quote(string $string, int $type = PDO::PARAM_STR) {}
/** @return bool */
public function rollBack() {}

/**
* @param array|int $value
* @return bool
*/
public function setAttribute(int $attribute, $value) {}
/** @return bool */
public function setAttribute(int $attribute, mixed $value) {}
}
4 changes: 2 additions & 2 deletions ext/pdo/pdo_dbh_arginfo.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 788d1cd616c140df4072c6e0564c2995fbdc84ad */
* Stub hash: 2952abcfab855d46f6e5fb9dcf447d87f06b6881 */

ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO___construct, 0, 0, 1)
ZEND_ARG_TYPE_INFO(0, dsn, IS_STRING, 0)
Expand Down Expand Up @@ -53,7 +53,7 @@ ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO_setAttribute, 0, 0, 2)
ZEND_ARG_TYPE_INFO(0, attribute, IS_LONG, 0)
ZEND_ARG_INFO(0, value)
ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0)
ZEND_END_ARG_INFO()


Expand Down

0 comments on commit 2e343fc

Please sign in to comment.