Fix compatibility with PHP 8.0 (latest XAMPP)

Solution by doctrine developers
This commit is contained in:
slawkens
2021-02-16 00:28:54 +01:00
parent 746a5dc816
commit dbc76abcdd
4 changed files with 30 additions and 4 deletions

View File

@@ -0,0 +1,25 @@
<?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);
}
}
} else {
trait OTS_DB_PDOQuery
{
/**
* @return PDOStatement
*/
public function query()
{
return $this->doQuery(...func_get_args());
}
}
}