From aa17ddbf2471c3ca450a278f347d6e55b891cf86 Mon Sep 17 00:00:00 2001 From: slawkens Date: Tue, 23 Feb 2021 15:10:03 +0100 Subject: [PATCH] Fix compatibility with PHP 7.0 and lower --- system/libs/pot/OTS_DB_PDOQuery.php | 11 +---------- system/libs/pot/OTS_DB_PDOQuery_PHP71.php | 12 ++++++++++++ 2 files changed, 13 insertions(+), 10 deletions(-) create mode 100644 system/libs/pot/OTS_DB_PDOQuery_PHP71.php diff --git a/system/libs/pot/OTS_DB_PDOQuery.php b/system/libs/pot/OTS_DB_PDOQuery.php index 24ebfa3a..315ecff6 100644 --- a/system/libs/pot/OTS_DB_PDOQuery.php +++ b/system/libs/pot/OTS_DB_PDOQuery.php @@ -1,16 +1,7 @@ = 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 { diff --git a/system/libs/pot/OTS_DB_PDOQuery_PHP71.php b/system/libs/pot/OTS_DB_PDOQuery_PHP71.php new file mode 100644 index 00000000..3bb91a46 --- /dev/null +++ b/system/libs/pot/OTS_DB_PDOQuery_PHP71.php @@ -0,0 +1,12 @@ +doQuery($query, $fetchMode, ...$fetchModeArgs); + } +}