Skip to content

Commit

Permalink
throw error if invalid type
Browse files Browse the repository at this point in the history
  • Loading branch information
Javakky-pxv committed Mar 12, 2021
1 parent d6e033a commit 09f533e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/FakePdoTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ public function setAttribute($key, $value)
$this->lowercaseResultKeys = true;
}

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

Expand Down

0 comments on commit 09f533e

Please sign in to comment.