Skip to content

Commit

Permalink
fix: Improve Database compatibility with PHP 7.4 (#1597)
Browse files Browse the repository at this point in the history
* this doesn't work on PHP7.4, removing return type

* make the function declaration compatible with pdo->query
  • Loading branch information
fiammybe authored Dec 29, 2024
1 parent a8b6551 commit 3acb39d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion htdocs/libraries/icms/db/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function escape($string) {
* @see PDO::query()
* @return
*/
public function query() {
public function query($statement, $fetchMode = null, ...$fetch_mode_args) {
$args = func_get_args();
$sql = $args[0];
// the use of icms_db_IConnection is correct - without it, the query count in debug is not correct
Expand Down
2 changes: 1 addition & 1 deletion htdocs/libraries/icms/db/mysql/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function escape($string) {
*/
// public function query($statement, $mode = PDO::ATTR_DEFAULT_FETCH_MODE, $arg3 = null, array $ctorargs = []) {
//PDO::query(string $query, ?int $fetchMode = null, mixed ...$fetchModeArgs): PDOStatement|false
public function query($statement, $fetchMode = PDO::ATTR_DEFAULT_FETCH_MODE, ...$fetch_mode_args): PDOStatement|false {
public function query($statement, $fetchMode = PDO::ATTR_DEFAULT_FETCH_MODE, ...$fetch_mode_args) {
$mode = $fetchMode;
$args = func_get_args();
$sql = $args[0];
Expand Down

0 comments on commit 3acb39d

Please sign in to comment.