From 334588974ad9a383bc9da90e1c3227142426edec Mon Sep 17 00:00:00 2001 From: Stephan Kasdorf Date: Thu, 29 Oct 2020 22:27:40 +0100 Subject: [PATCH] Version 0.9.5 beta - Core update removed dependencies for the Postgres to MySQL, since it made no sense, also removed the ODBC dependencies for MySQL since it made no sense, will be added to the current Nibiru core version v0.9.5. Also added the correct return types for the PDO adapter so it has code completion. --- core/c/mysql.php | 14 +++++++++----- core/c/odbc.php | 2 +- core/c/psql.php | 4 ++-- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/core/c/mysql.php b/core/c/mysql.php index 88bad66..8c7fe0d 100755 --- a/core/c/mysql.php +++ b/core/c/mysql.php @@ -47,7 +47,11 @@ class Mysql implements IMysql } } - public static function getInstance( $section = false ) + /** + * @param false $section + * @return Mysql + */ + public static function getInstance( $section = false ): Mysql { $className = get_called_class(); if(self::$_instance==null) self::$_instance = new $className( $section ); @@ -150,10 +154,10 @@ class Mysql implements IMysql $this->_dbname = $dbname; } - /** - * @return string - */ - protected function getConn() + /** + * @return \PDO + */ + public function getConn(): \PDO { return $this->_conn; } diff --git a/core/c/odbc.php b/core/c/odbc.php index 18f74ec..a8728f0 100755 --- a/core/c/odbc.php +++ b/core/c/odbc.php @@ -46,7 +46,7 @@ class Odbc extends Mysql implements IOdbc } - public static function getInstance( $section = false ) + public static function getInstance( $section = false ): Mysql { $className = get_called_class(); if(self::$_instance==null) self::$_instance = new $className( $section ); diff --git a/core/c/psql.php b/core/c/psql.php index 6b621eb..3f58c8d 100644 --- a/core/c/psql.php +++ b/core/c/psql.php @@ -7,7 +7,7 @@ namespace Nibiru; * Time: 11:02 */ -class Psql extends Mysql implements IPsql +class Psql implements IPsql { use Messages; @@ -45,7 +45,7 @@ class Psql extends Mysql implements IPsql } } - public static function getInstance( $section = false ) + public static function getInstance( $section = false ): Psql { $className = get_called_class(); if(self::$_instance==null) self::$_instance = new $className( $section );