mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-03 16:51:40 +09:00
Remove all type declarations in DBHelper/DBStmtHelper methods inherited from PDO, for broad compatibility with PHP 7 and 8
This commit is contained in:
parent
80afad9d07
commit
a6872d6e2a
2 changed files with 6 additions and 6 deletions
|
|
@ -35,7 +35,7 @@ class DBHelper extends \PDO
|
|||
* @return DBStmtHelper
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function prepare(string $statement, array $options = []): DBStmtHelper
|
||||
public function prepare($statement, $options = null): DBStmtHelper
|
||||
{
|
||||
$start_time = microtime(true);
|
||||
$db_class = DB::getInstance($this->_type);
|
||||
|
|
@ -89,7 +89,7 @@ class DBHelper extends \PDO
|
|||
* @return DBStmtHelper|false
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function query(string $statement, ?int $fetch_mode = \PDO::FETCH_OBJ, ...$fetch_mode_args)
|
||||
public function query($statement, $fetch_mode = \PDO::FETCH_OBJ, ...$fetch_mode_args)
|
||||
{
|
||||
$start_time = microtime(true);
|
||||
$db_class = DB::getInstance($this->_type);
|
||||
|
|
@ -133,14 +133,14 @@ class DBHelper extends \PDO
|
|||
* @return int|false
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function exec(string $query)
|
||||
public function exec($statement)
|
||||
{
|
||||
$start_time = microtime(true);
|
||||
$db_class = DB::getInstance($this->_type);
|
||||
|
||||
try
|
||||
{
|
||||
$result = parent::exec($query);
|
||||
$result = parent::exec($statement);
|
||||
$db_class->clearError();
|
||||
}
|
||||
catch (\PDOException $e)
|
||||
|
|
@ -153,7 +153,7 @@ class DBHelper extends \PDO
|
|||
$db_class->addElapsedTime($elapsed_time);
|
||||
if (Debug::isEnabledForCurrentUser())
|
||||
{
|
||||
Debug::addQuery($db_class->getQueryLog($query, $elapsed_time));
|
||||
Debug::addQuery($db_class->getQueryLog($statement, $elapsed_time));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ class DBStmtHelper extends \PDOStatement
|
|||
* @param array $params
|
||||
* @return bool
|
||||
*/
|
||||
public function execute(?array $params = null): bool
|
||||
public function execute($params = null): bool
|
||||
{
|
||||
$start_time = microtime(true);
|
||||
$db_class = DB::getInstance($this->_type);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue