From afa17ca4296034246aabe348eb72e0d938d9708a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Sun, 18 Jun 2023 16:12:39 +0200 Subject: [PATCH] Explicitly convert the database size to an int to prevent type error --- src/Services/Misc/DBInfoHelper.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Services/Misc/DBInfoHelper.php b/src/Services/Misc/DBInfoHelper.php index eb75a254..29440d26 100644 --- a/src/Services/Misc/DBInfoHelper.php +++ b/src/Services/Misc/DBInfoHelper.php @@ -83,7 +83,7 @@ class DBInfoHelper { if ($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform) { try { - return $this->connection->fetchOne('SELECT SUM(data_length + index_length) FROM information_schema.TABLES WHERE table_schema = DATABASE()'); + return (int) $this->connection->fetchOne('SELECT SUM(data_length + index_length) FROM information_schema.TABLES WHERE table_schema = DATABASE()'); } catch (Exception) { return null; } @@ -91,7 +91,7 @@ class DBInfoHelper if ($this->connection->getDatabasePlatform() instanceof SqlitePlatform) { try { - return $this->connection->fetchOne('SELECT page_count * page_size as size FROM pragma_page_count(), pragma_page_size();'); + return (int) $this->connection->fetchOne('SELECT page_count * page_size as size FROM pragma_page_count(), pragma_page_size();'); } catch (Exception) { return null; }