From cefffde69169b049b0256a74ec487d7800c2eb47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roland=20H=C3=A4der?= Date: Mon, 20 Jun 2022 03:10:02 +0200 Subject: [PATCH] Changes: - added type-hints - added some missing documentation --- src/Database/DBA.php | 6 +++--- src/Database/Database.php | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Database/DBA.php b/src/Database/DBA.php index e519a63cd6..a797d3235b 100644 --- a/src/Database/DBA.php +++ b/src/Database/DBA.php @@ -218,12 +218,12 @@ class DBA /** * Check if data exists * - * @param string|array $table Table name or array [schema => table] - * @param array $condition array of fields for condition + * @param string $table Table name or array [schema => table] + * @param array $condition Array of fields for condition * @return boolean Are there rows for that condition? * @throws \Exception */ - public static function exists($table, array $condition): bool + public static function exists(string $table, array $condition): bool { return DI::dba()->exists($table, $condition); } diff --git a/src/Database/Database.php b/src/Database/Database.php index 8c2cd0241d..384e1d1a65 100644 --- a/src/Database/Database.php +++ b/src/Database/Database.php @@ -1527,6 +1527,7 @@ class Database */ public function count($table, array $condition = [], array $params = []): int { + // @TODO Can we dump this to have ": int" as returned type-hint? if (empty($table)) { throw new InvalidArgumentException('Parameter "table" cannot be empty.'); }