diff --git a/helpers/db.php b/helpers/db.php index 195589d..adbfc3c 100644 --- a/helpers/db.php +++ b/helpers/db.php @@ -26,7 +26,7 @@ /** * Singleton instance * - * @var mysqli Object instance + * @var uDb Object instance */ protected static $instance; @@ -40,7 +40,7 @@ /** * Database driver name * - * @var String Driver + * @var string Driver */ protected static $driver; @@ -82,7 +82,7 @@ /** * Returns singleton instance * - * @return object Singleton instance + * @return uDb Singleton instance */ public static function getInstance() { if (!self::$instance) { diff --git a/helpers/position.php b/helpers/position.php index 08e43f3..887e39e 100644 --- a/helpers/position.php +++ b/helpers/position.php @@ -89,10 +89,7 @@ * @return uDb instance */ private static function db() { - if (is_null(self::$db)) { - self::$db = uDb::getInstance(); - } - return self::$db; + return uDb::getInstance(); } /** diff --git a/helpers/track.php b/helpers/track.php index 3dbdb67..3e7eacc 100644 --- a/helpers/track.php +++ b/helpers/track.php @@ -31,6 +31,9 @@ public $isValid = false; + /** + * @var uDb $db + */ private static $db = null; /** @@ -66,10 +69,7 @@ * @return uDb instance */ private static function db() { - if (is_null(self::$db)) { - self::$db = uDb::getInstance(); - } - return self::$db; + return uDb::getInstance(); } /** @@ -102,7 +102,7 @@ * Add new position to track * * @param int $userId - * @param int $time Unix time stamp + * @param int $timestamp Unix time stamp * @param double $lat * @param double $lon * @param double $altitude Optional diff --git a/helpers/user.php b/helpers/user.php index b35a115..7496829 100644 --- a/helpers/user.php +++ b/helpers/user.php @@ -67,10 +67,7 @@ * @return uDb instance */ private static function db() { - if (is_null(self::$db)) { - self::$db = uDb::getInstance(); - } - return self::$db; + return uDb::getInstance(); } /**