Fix compatibility with PHP 7.0 and lower

This commit is contained in:
slawkens 2021-02-23 15:10:03 +01:00
parent 62faacbed6
commit aa17ddbf24
2 changed files with 13 additions and 10 deletions

View File

@ -1,16 +1,7 @@
<?php
if (PHP_VERSION_ID >= 80000) {
trait OTS_DB_PDOQuery
{
/**
* @return PDOStatement
*/
public function query(?string $query = null, ?int $fetchMode = null, mixed ...$fetchModeArgs)
{
return $this->doQuery($query, $fetchMode, ...$fetchModeArgs);
}
}
require LIBS . 'pot/OTS_DB_PDOQuery_PHP71.php';
} else {
trait OTS_DB_PDOQuery
{

View File

@ -0,0 +1,12 @@
<?php
trait OTS_DB_PDOQuery
{
/**
* @return PDOStatement
*/
public function query(?string $query = null, ?int $fetchMode = null, mixed ...$fetchModeArgs)
{
return $this->doQuery($query, $fetchMode, ...$fetchModeArgs);
}
}