From 46e1419ef5c3a8ec45587394ce8355b3fa2916d1 Mon Sep 17 00:00:00 2001 From: Clemens Schwaighofer Date: Wed, 30 Aug 2023 19:26:13 +0900 Subject: [PATCH] phan checks and updates --- .phan/config.php | 2 ++ www/admin/class_test.db.php | 8 ++++++++ www/lib/CoreLibs/DB/IO.php | 1 + 3 files changed, 11 insertions(+) diff --git a/.phan/config.php b/.phan/config.php index 70a74c43..17b20a04 100644 --- a/.phan/config.php +++ b/.phan/config.php @@ -132,6 +132,8 @@ return [ // start ignore annotations 'PhanUnextractableAnnotationElementName', 'PhanUnextractableAnnotationSuffix', + // enum problems in comments + 'PhanCommentObjectInClassConstantType' ], // Override to hardcode existence and types of (non-builtin) globals in the global scope. diff --git a/www/admin/class_test.db.php b/www/admin/class_test.db.php index 507956fd..c791d8a9 100644 --- a/www/admin/class_test.db.php +++ b/www/admin/class_test.db.php @@ -75,6 +75,14 @@ $db->dbResetEncoding(); // empty calls, none of the below should fail // +$db->dbGetCursor(); +// +$db->dbGetCursorExt(); +// +$db->dbGetCursorPos('SELECT foo', ['bar']); +// +$db->dbGetCursorNumRows('SELECT foo', ['bar']); +// $db->dbGetInsertPKName(); // $db->dbGetInsertPK(); diff --git a/www/lib/CoreLibs/DB/IO.php b/www/lib/CoreLibs/DB/IO.php index 398ba1ce..59cad655 100644 --- a/www/lib/CoreLibs/DB/IO.php +++ b/www/lib/CoreLibs/DB/IO.php @@ -340,6 +340,7 @@ class IO // 4: convert numeric/floatN to float (CONVERT_NUMERIC) // 8: convert bytea to string data (CONVERT_BYTEA) /** @var int type settings as bit mask, 0 for off, anything >2 will aways set 1 too */ + /** @phan-suppress-next-line PhanInvalidConstantExpression PhanUndeclaredClassConstant */ private int $convert_type = Convert::off->value; // FOR BELOW: (This should be private and only readable through some method) // cursor array for cached readings