summaryrefslogtreecommitdiff
path: root/src/Database/Db.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Database/Db.php')
-rw-r--r--src/Database/Db.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/Database/Db.php b/src/Database/Db.php
index 30f63494..d007f1e5 100644
--- a/src/Database/Db.php
+++ b/src/Database/Db.php
@@ -46,14 +46,19 @@ class Db
*
* @param string $query
* @param array $bindings
- * @return array
+ * @return array|null
*/
public static function selectOne($query, array $bindings = [])
{
$result = self::connection()->selectOne($query, $bindings);
// @TODO: remove typecast
- return (array)$result;
+ $result = (array)$result;
+ if (empty($result)) {
+ return null;
+ }
+
+ return $result;
}
/**