Skip to content

Commit 09f533e

Browse files
committed
throw error if invalid type
1 parent d6e033a commit 09f533e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/FakePdoTrait.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,10 @@ public function setAttribute($key, $value)
7373
$this->lowercaseResultKeys = true;
7474
}
7575

76-
if ($key === \PDO::ATTR_DEFAULT_FETCH_MODE && is_int($value)) {
76+
if ($key === \PDO::ATTR_DEFAULT_FETCH_MODE) {
77+
if (!is_int($value)) {
78+
throw new \PDOException("SQLSTATE[HY000]: General error: invalid fetch mode type");
79+
}
7780
$this->defaultFetchMode = $value;
7881
}
7982

0 commit comments

Comments
 (0)