Files
FreshRSS/lib/Minz/PdoMysql.php
Alexandre Alapetite c72914bba2 PHPStan Level 7 for more DAO PDO (#5328)
* PHPStan Level 7 for more DAO PDO
With new function to address common type and check problems

* A bit more

* PHPStan Level 7 for FreshRSS_Entry
2023-04-28 14:01:11 +02:00

28 lines
733 B
PHP

<?php
/**
* MINZ - Copyright 2011 Marien Fressinaud
* Sous licence AGPL3 <http://www.gnu.org/licenses/>
*/
class Minz_PdoMysql extends Minz_Pdo {
/** @param array<int,int|string|bool>|null $options */
public function __construct(string $dsn, ?string $username = null, ?string $passwd = null, ?array $options = null) {
parent::__construct($dsn, $username, $passwd, $options);
$this->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, false);
}
public function dbType(): string {
return 'mysql';
}
/**
* @param string|null $name
* @return string|false
*/
#[\ReturnTypeWillChange]
public function lastInsertId($name = null) {
return parent::lastInsertId(); //We discard the name, only used by PostgreSQL
}
}