Use singleton instance directly

This commit is contained in:
Bartek Fabiszewski 2019-05-15 11:48:24 +02:00
parent 69cf9ade47
commit 3966c697b7
4 changed files with 10 additions and 16 deletions

View File

@ -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) {

View File

@ -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();
}
/**

View File

@ -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

View File

@ -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();
}
/**