mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-08 00:52:01 +01:00
Fix phan warnings
This commit is contained in:
@@ -45,6 +45,8 @@ class DoliDBSqlite3 extends DoliDB
|
||||
*/
|
||||
private $_results;
|
||||
|
||||
private $queryString;
|
||||
|
||||
const WEEK_MONDAY_FIRST = 1;
|
||||
const WEEK_YEAR = 2;
|
||||
const WEEK_FIRST_WEEKDAY = 4;
|
||||
@@ -396,7 +398,7 @@ class DoliDBSqlite3 extends DoliDB
|
||||
* Note that with Mysql, this parameter is not used as Myssql can already commit a transaction even if one request is in error, without using savepoints.
|
||||
* @param string $type Type of SQL order ('ddl' for insert, update, select, delete or 'dml' for create, alter...)
|
||||
* @param int $result_mode Result mode (not used with sqlite)
|
||||
* @return bool|SQLite3Result|null Resultset of answer
|
||||
* @return false|SQLite3Result Resultset of answer
|
||||
*/
|
||||
public function query($query, $usesavepoint = 0, $type = 'auto', $result_mode = 0)
|
||||
{
|
||||
@@ -473,7 +475,7 @@ class DoliDBSqlite3 extends DoliDB
|
||||
//$ret = $this->db->exec($query);
|
||||
$ret = $this->db->query($query); // $ret is a Sqlite3Result
|
||||
if ($ret) {
|
||||
$ret->queryString = $query;
|
||||
$this->queryString = $query;
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
$this->error = $this->db->lastErrorMsg();
|
||||
@@ -581,7 +583,6 @@ class DoliDBSqlite3 extends DoliDB
|
||||
public function num_rows($resultset)
|
||||
{
|
||||
// phpcs:enable
|
||||
// FIXME: SQLite3Result does not have a queryString member
|
||||
|
||||
// If resultset not provided, we take the last used by connection
|
||||
if (!is_object($resultset)) {
|
||||
@@ -604,13 +605,12 @@ class DoliDBSqlite3 extends DoliDB
|
||||
public function affected_rows($resultset)
|
||||
{
|
||||
// phpcs:enable
|
||||
// FIXME: SQLite3Result does not have a queryString member
|
||||
|
||||
// If resultset not provided, we take the last used by connection
|
||||
if (!is_object($resultset)) {
|
||||
$resultset = $this->_results;
|
||||
}
|
||||
if (preg_match("/^SELECT/i", $resultset->queryString)) {
|
||||
if (preg_match("/^SELECT/i", $this->queryString)) {
|
||||
return $this->num_rows($resultset);
|
||||
}
|
||||
// mysql necessite un link de base pour cette fonction contrairement
|
||||
@@ -841,7 +841,7 @@ class DoliDBSqlite3 extends DoliDB
|
||||
* @param string $charset Charset used to store data
|
||||
* @param string $collation Charset used to sort data
|
||||
* @param string $owner Username of database owner
|
||||
* @return SQLite3Result resource defined if OK, null if KO
|
||||
* @return false|SQLite3Result Resource defined if OK, null if KO
|
||||
*/
|
||||
public function DDLCreateDb($database, $charset = '', $collation = '', $owner = '')
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user