]> git.joonet.de Git - adminer.git/commitdiff
Doc-comments: Fix type errors
authorJakub Vrana <jakub@vrana.cz>
Fri, 28 Mar 2025 09:25:11 +0000 (10:25 +0100)
committerJakub Vrana <jakub@vrana.cz>
Fri, 28 Mar 2025 11:47:06 +0000 (12:47 +0100)
16 files changed:
adminer/drivers/mssql.inc.php
adminer/drivers/mysql.inc.php
adminer/drivers/oracle.inc.php
adminer/drivers/pgsql.inc.php
adminer/drivers/sqlite.inc.php
adminer/include/editing.inc.php
adminer/include/functions.inc.php
adminer/include/pdo.inc.php
adminer/include/tmpfile.inc.php
phpstan.neon
plugins/drivers/clickhouse.php
plugins/drivers/elastic.php
plugins/drivers/firebird.php
plugins/drivers/imap.php
plugins/drivers/mongo.php
plugins/drivers/simpledb.php

index 7b16d85b16a8f121f63c4c6a7d7fa7c169f10275..d50004aed2f37fd54573701d4741bd7c1b2dfe6f 100644 (file)
@@ -13,7 +13,7 @@ if (isset($_GET["mssql"])) {
        define('Adminer\DRIVER', "mssql");
        if (extension_loaded("sqlsrv") && $_GET["ext"] != "pdo") {
                class Db extends SqlDb {
-                       public $extension = "sqlsrv";
+                       public string $extension = "sqlsrv";
                        private $link, $result;
 
                        private function get_error() {
@@ -124,7 +124,7 @@ if (isset($_GET["mssql"])) {
                                return $this->convert(sqlsrv_fetch_array($this->result, SQLSRV_FETCH_NUMERIC));
                        }
 
-                       function fetch_field(): object {
+                       function fetch_field(): \stdClass {
                                if (!$this->fields) {
                                        $this->fields = sqlsrv_field_metadata($this->result);
                                }
@@ -180,7 +180,7 @@ if (isset($_GET["mssql"])) {
 
                if (extension_loaded("pdo_sqlsrv")) {
                        class Db extends MssqlDb {
-                               public $extension = "PDO_SQLSRV";
+                               public string $extension = "PDO_SQLSRV";
 
                                function connect(string $server, string $username, string $password): bool {
                                        $this->dsn("sqlsrv:Server=" . str_replace(":", ",", $server), $username, $password);
@@ -190,7 +190,7 @@ if (isset($_GET["mssql"])) {
 
                } elseif (extension_loaded("pdo_dblib")) {
                        class Db extends MssqlDb {
-                               public $extension = "PDO_DBLIB";
+                               public string $extension = "PDO_DBLIB";
 
                                function connect(string $server, string $username, string $password): bool {
                                        $this->dsn("dblib:charset=utf8;host=" . str_replace(":", ";unix_socket=", preg_replace('~:(\d)~', ';port=\1', $server)), $username, $password);
@@ -202,10 +202,10 @@ if (isset($_GET["mssql"])) {
 
 
        class Driver extends SqlDriver {
-               static $possibleDrivers = array("SQLSRV", "PDO_SQLSRV", "PDO_DBLIB");
-               static $jush = "mssql";
+               static array $possibleDrivers = array("SQLSRV", "PDO_SQLSRV", "PDO_DBLIB");
+               static string $jush = "mssql";
 
-               public $editFunctions = array(
+               public array $editFunctions = array(
                        array(
                                "date|time" => "getdate",
                        ), array(
@@ -214,11 +214,11 @@ if (isset($_GET["mssql"])) {
                        )
                );
 
-               public $operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL");
-               public $functions = array("len", "lower", "round", "upper");
-               public $grouping = array("avg", "count", "count distinct", "max", "min", "sum");
-               public $onActions = "NO ACTION|CASCADE|SET NULL|SET DEFAULT";
-               public $generated = array("PERSISTED", "VIRTUAL");
+               public array $operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL");
+               public array $functions = array("len", "lower", "round", "upper");
+               public array $grouping = array("avg", "count", "count distinct", "max", "min", "sum");
+               public array $generated = array("PERSISTED", "VIRTUAL");
+               public string $onActions = "NO ACTION|CASCADE|SET NULL|SET DEFAULT";
 
                function __construct(Db $connection) {
                        parent::__construct($connection);
index be50d52ac375d08c8e47b331d1b933f29f870002..d681dbfc0c0fc7afc6dde772f691c760af5f5420 100644 (file)
@@ -8,7 +8,7 @@ if (!defined('Adminer\DRIVER')) {
        // MySQLi supports everything, MySQL doesn't support multiple result sets, PDO_MySQL doesn't support orgtable
        if (extension_loaded("mysqli") && $_GET["ext"] != "pdo") {
                class Db extends \MySQLi {
-                       public $extension = "MySQLi", $flavor = '';
+                       public string $extension = "MySQLi", $flavor = '';
 
                        function __construct() {
                                parent::init();
@@ -61,7 +61,7 @@ if (!defined('Adminer\DRIVER')) {
 
        } elseif (extension_loaded("mysql") && !((ini_bool("sql.safe_mode") || ini_bool("mysql.allow_local_infile")) && extension_loaded("pdo_mysql"))) {
                class Db extends SqlDb {
-                       private resource $link;
+                       /** @var resource */ private $link;
 
                        function connect(string $server, string $username, string $password): bool {
                                if (ini_bool("mysql.allow_local_infile")) {
@@ -122,10 +122,11 @@ if (!defined('Adminer\DRIVER')) {
 
                class Result {
                        public int $num_rows; // number of rows in the result
-                       private resource $result;
+                       /** @var resource */ private $result;
                        private int $offset = 0;
 
-                       function __construct(resource $result) {
+                       /** @param resource $result */
+                       function __construct($result) {
                                $this->result = $result;
                                $this->num_rows = mysql_num_rows($result);
                        }
@@ -145,9 +146,9 @@ if (!defined('Adminer\DRIVER')) {
                        }
 
                        /** Fetch next field
-                       * @return object properties: name, type (0 number, 15 varchar, 254 char), charsetnr (63 binary); optionally: table, orgtable, orgname
+                       * @return \stdClass properties: name, type (0 number, 15 varchar, 254 char), charsetnr (63 binary); optionally: table, orgtable, orgname
                        */
-                       function fetch_field(): object {
+                       function fetch_field(): \stdClass {
                                $return = mysql_fetch_field($this->result, $this->offset++); // offset required under certain conditions
                                $return->orgtable = $return->table;
                                $return->charsetnr = ($return->blob ? 63 : 0);
@@ -162,7 +163,7 @@ if (!defined('Adminer\DRIVER')) {
 
        } elseif (extension_loaded("pdo_mysql")) {
                class Db extends PdoDb {
-                       public $extension = "PDO_MySQL";
+                       public string $extension = "PDO_MySQL";
 
                        function connect(string $server, string $username, string $password): bool {
                                global $adminer;
index 55c9447f0a6a279f13fdd5c9e38c96ab7958a7d5..bc8ca5494a1703b8c9b80ce974094a5ace446f76 100644 (file)
@@ -7,7 +7,7 @@ if (isset($_GET["oracle"])) {
        define('Adminer\DRIVER', "oracle");
        if (extension_loaded("oci8") && $_GET["ext"] != "pdo") {
                class Db extends SqlDb {
-                       public $extension = "oci8";
+                       public string $extension = "oci8";
                        public $_current_db;
                        private $link;
 
@@ -87,7 +87,7 @@ if (isset($_GET["oracle"])) {
                                return $this->convert(oci_fetch_row($this->result));
                        }
 
-                       function fetch_field(): object {
+                       function fetch_field(): \stdClass {
                                $column = $this->offset++;
                                $return = new \stdClass;
                                $return->name = oci_field_name($this->result, $column);
@@ -103,7 +103,7 @@ if (isset($_GET["oracle"])) {
 
        } elseif (extension_loaded("pdo_oci")) {
                class Db extends PdoDb {
-                       public $extension = "PDO_OCI";
+                       public string $extension = "PDO_OCI";
                        public $_current_db;
 
                        function connect(string $server, string $username, string $password): bool {
@@ -122,10 +122,10 @@ if (isset($_GET["oracle"])) {
 
 
        class Driver extends SqlDriver {
-               static $possibleDrivers = array("OCI8", "PDO_OCI");
-               static $jush = "oracle";
+               static array $possibleDrivers = array("OCI8", "PDO_OCI");
+               static string $jush = "oracle";
 
-               public $editFunctions = array(
+               public array $editFunctions = array(
                        array( //! no parentheses
                                "date" => "current_date",
                                "timestamp" => "current_timestamp",
@@ -136,9 +136,9 @@ if (isset($_GET["oracle"])) {
                        )
                );
 
-               public $operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL", "SQL");
-               public $functions = array("length", "lower", "round", "upper");
-               public $grouping = array("avg", "count", "count distinct", "max", "min", "sum");
+               public array $operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL", "SQL");
+               public array $functions = array("length", "lower", "round", "upper");
+               public array $grouping = array("avg", "count", "count distinct", "max", "min", "sum");
 
                function __construct(Db $connection) {
                        parent::__construct($connection);
index 069e329f248f08e59e503a55c3ea5285add267d5..97c5173c44e6c687a341a4b270a98fe5fc8c0142 100644 (file)
@@ -7,7 +7,8 @@ if (isset($_GET["pgsql"])) {
        define('Adminer\DRIVER', "pgsql");
        if (extension_loaded("pgsql") && $_GET["ext"] != "pdo") {
                class Db extends SqlDb {
-                       public $extension = "PgSQL", $timeout;
+                       public string $extension = "PgSQL";
+                       public int $timeout;
                        private $link, $string, $database = true;
 
                        function _error($errno, $error) {
@@ -108,7 +109,7 @@ if (isset($_GET["pgsql"])) {
                                return pg_fetch_row($this->result);
                        }
 
-                       function fetch_field(): object {
+                       function fetch_field(): \stdClass {
                                $column = $this->offset++;
                                $return = new \stdClass;
                                $return->orgtable = pg_field_table($this->result, $column);
@@ -125,7 +126,8 @@ if (isset($_GET["pgsql"])) {
 
        } elseif (extension_loaded("pdo_pgsql")) {
                class Db extends PdoDb {
-                       public $extension = "PDO_PgSQL", $timeout;
+                       public string $extension = "PDO_PgSQL";
+                       public int $timeout;
 
                        function connect(string $server, string $username, string $password): bool {
                                global $adminer;
@@ -167,12 +169,12 @@ if (isset($_GET["pgsql"])) {
 
 
        class Driver extends SqlDriver {
-               static $possibleDrivers = array("PgSQL", "PDO_PgSQL");
-               static $jush = "pgsql";
+               static array $possibleDrivers = array("PgSQL", "PDO_PgSQL");
+               static string $jush = "pgsql";
 
-               public $operators = array("=", "<", ">", "<=", ">=", "!=", "~", "!~", "LIKE", "LIKE %%", "ILIKE", "ILIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL"); // no "SQL" to avoid CSRF
-               public $functions = array("char_length", "lower", "round", "to_hex", "to_timestamp", "upper");
-               public $grouping = array("avg", "count", "count distinct", "max", "min", "sum");
+               public array $operators = array("=", "<", ">", "<=", ">=", "!=", "~", "!~", "LIKE", "LIKE %%", "ILIKE", "ILIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL"); // no "SQL" to avoid CSRF
+               public array $functions = array("char_length", "lower", "round", "to_hex", "to_timestamp", "upper");
+               public array $grouping = array("avg", "count", "count distinct", "max", "min", "sum");
 
                function __construct(Db $connection) {
                        parent::__construct($connection);
index f7a0f3c0659d2cb7393e3dfc079ee81af99930d1..b6b7e6234086f287357bc7ce869959a370439ea4 100644 (file)
@@ -8,7 +8,7 @@ if (isset($_GET["sqlite"])) {
        if (class_exists("SQLite3") && $_GET["ext"] != "pdo") {
 
                abstract class SqliteDb extends SqlDb {
-                       public $extension = "SQLite3";
+                       public string $extension = "SQLite3";
                        private $link;
 
                        function connect(string $filename, string $username = '', string $password = ''): bool {
@@ -56,7 +56,7 @@ if (isset($_GET["sqlite"])) {
                                return $this->result->fetchArray(SQLITE3_NUM);
                        }
 
-                       function fetch_field(): object {
+                       function fetch_field(): \stdClass {
                                $column = $this->offset++;
                                $type = $this->result->columnType($column);
                                return (object) array(
@@ -73,7 +73,7 @@ if (isset($_GET["sqlite"])) {
 
        } elseif (extension_loaded("pdo_sqlite")) {
                abstract class SqliteDb extends PdoDb {
-                       public $extension = "PDO_SQLite";
+                       public string $extension = "PDO_SQLite";
 
                        function connect(string $filename, string $username = '', string $password = ''): bool {
                                $this->dsn(DRIVER . ":$filename", "", "");
@@ -106,12 +106,12 @@ if (isset($_GET["sqlite"])) {
 
 
        class Driver extends SqlDriver {
-               static $possibleDrivers = array("SQLite3", "PDO_SQLite");
-               static $jush = "sqlite";
+               static array $possibleDrivers = array("SQLite3", "PDO_SQLite");
+               static string $jush = "sqlite";
 
-               protected $types = array(array("integer" => 0, "real" => 0, "numeric" => 0, "text" => 0, "blob" => 0));
+               protected array $types = array(array("integer" => 0, "real" => 0, "numeric" => 0, "text" => 0, "blob" => 0));
 
-               public $editFunctions = array(
+               public array $editFunctions = array(
                        array(
                                // "text" => "date('now')/time('now')/datetime('now')",
                        ), array(
@@ -121,9 +121,9 @@ if (isset($_GET["sqlite"])) {
                        )
                );
 
-               public $operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL", "SQL"); // REGEXP can be user defined function
-               public $functions = array("hex", "length", "lower", "round", "unixepoch", "upper");
-               public $grouping = array("avg", "count", "count distinct", "group_concat", "max", "min", "sum");
+               public array $operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL", "SQL"); // REGEXP can be user defined function
+               public array $functions = array("hex", "length", "lower", "round", "unixepoch", "upper");
+               public array $grouping = array("avg", "count", "count distinct", "group_concat", "max", "min", "sum");
 
                function __construct(Db $connection) {
                        parent::__construct($connection);
index f30b1f3c34248a615007b65a64cef207f9bcdc5b..e59c589d45cdd90c6c8ca513f77c05b628097685 100644 (file)
@@ -361,7 +361,7 @@ function edit_fields(array $fields, array $collations, $type = "TABLE", array $f
 /** Move fields up and down or add field
 * @param Field[] $fields
 */
-function process_fields(&array $fields): bool {
+function process_fields(array &$fields): bool {
        $offset = 0;
        if ($_POST["up"]) {
                $last = 0;
index 5266fcebfe90ee89f79a441b37d3e9ff0abbe2b7..46dd2be70ab51ef0ca8bee3759e95110be882a91 100644 (file)
@@ -476,7 +476,7 @@ function queries(string $query) {
 * @param list<string> $tables
 * @param callable(string):string $escape
 */
-function apply_queries(string $query, array $tables, callable $escape = 'Adminer\table'): bool {
+function apply_queries(string $query, array $tables, $escape = 'Adminer\table'): bool {
        foreach ($tables as $table) {
                if (!queries("$query " . $escape($table))) {
                        return false;
@@ -712,16 +712,20 @@ function file_open_lock(string $filename) {
        return $fp;
 }
 
-/** Write and unlock a file */
-function file_write_unlock(resource $fp, string $data): void {
+/** Write and unlock a file
+* @param resource $fp
+*/
+function file_write_unlock($fp, string $data): void {
        rewind($fp);
        fwrite($fp, $data);
        ftruncate($fp, strlen($data));
        file_unlock($fp);
 }
 
-/** Unlock and close a file */
-function file_unlock(resource $fp): void {
+/** Unlock and close a file
+* @param resource $fp
+*/
+function file_unlock($fp): void {
        flock($fp, LOCK_UN);
        fclose($fp);
 }
index 3169529bf218c53eb84ea622612cf77ebea0b673..cf9f2d19e70b81c7eb06dc834b32bf93f467131f 100644 (file)
@@ -76,7 +76,7 @@ if (extension_loaded('pdo')) {
                        return $this->fetch(\PDO::FETCH_NUM);
                }
 
-               function fetch_field(): object {
+               function fetch_field(): \stdClass {
                        $row = (object) $this->getColumnMeta($this->_offset++);
                        $type = $row->pdo_type;
                        $row->type = ($type == \PDO::PARAM_INT ? 0 : 15);
index 02a0101ddf1f5767ad2aa0dffedc7ea9b4746d64..88b7712c2276c2dd4a71557a21c1a4af00f8f8e2 100644 (file)
@@ -2,7 +2,7 @@
 namespace Adminer;
 
 class TmpFile {
-       private resource $handler;
+       /** @var resource */ private $handler;
        /** @visibility protected(set) */ public int $size;
 
        function __construct() {
index 99bc9d14cb21ad4d7e2995cc5e825ca03ee551cb..fee0205b70276bd076ca677823f20f4f73f19dc5 100644 (file)
@@ -24,7 +24,7 @@ parameters:
                        paths:
                                - adminer/include/pdo.inc.php
                                - adminer/drivers/*
-                               
+
                -
                        message: "~ to an undefined ~" # PostgreSQL has this in its version of Db
                        path: adminer/drivers/pgsql.inc.php
@@ -52,6 +52,7 @@ parameters:
        scanFiles:
                - compile.php # compile_file()
        excludePaths:
+               - adminer/adminer-plugins/
                - adminer/lang/
                - adminer/adminer-plugins.php
                - adminer/designs.php
@@ -59,7 +60,7 @@ parameters:
                - adminer/sqlite.php
 
        phpVersion:
-               min: 70100
+               min: 70400
                max: 80499
 
        typeAliases:
index f434e1adc900c34ee544e894d25b49ef9c067969..b7ca723a1b41d84354af09297ee8b0cd796ed10d 100644 (file)
@@ -8,7 +8,7 @@ if (isset($_GET["clickhouse"])) {
 
        if (ini_bool('allow_url_fopen')) {
                class Db extends SqlDb {
-                       public $extension = "JSON";
+                       public string $extension = "JSON";
                        public $_db = 'default';
                        private $url;
 
@@ -103,7 +103,7 @@ if (isset($_GET["clickhouse"])) {
                                return $row;
                        }
 
-                       function fetch_field(): object {
+                       function fetch_field(): \stdClass {
                                $column = $this->offset++;
                                $return = new \stdClass;
                                if ($column < count($this->columns)) {
@@ -117,11 +117,11 @@ if (isset($_GET["clickhouse"])) {
        }
 
        class Driver extends SqlDriver {
-               static $possibleDrivers = array("allow_url_fopen");
-               static $jush = "clickhouse";
+               static array $possibleDrivers = array("allow_url_fopen");
+               static string $jush = "clickhouse";
 
-               public $operators = array("=", "<", ">", "<=", ">=", "!=", "~", "!~", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL", "SQL");
-               public $grouping = array("avg", "count", "count distinct", "max", "min", "sum");
+               public array $operators = array("=", "<", ">", "<=", ">=", "!=", "~", "!~", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL", "SQL");
+               public array $grouping = array("avg", "count", "count distinct", "max", "min", "sum");
 
                function __construct(Db $connection) {
                        parent::__construct($connection);
index 5e5e13433324516fe448c9f7f9b932fba75dc0cd..7f99eaf71e0f28245f015192c22f42b44055da01 100644 (file)
@@ -9,7 +9,7 @@ if (isset($_GET["elastic"])) {
        if (ini_bool('allow_url_fopen')) {
 
                class Db extends SqlDb {
-                       public $extension = "JSON";
+                       public string $extension = "JSON";
                        private $url;
 
                        /**
@@ -108,11 +108,11 @@ if (isset($_GET["elastic"])) {
        }
 
        class Driver extends SqlDriver {
-               static $possibleDrivers = array("json + allow_url_fopen");
-               static $jush = "elastic";
+               static array $possibleDrivers = array("json + allow_url_fopen");
+               static string $jush = "elastic";
 
-               public $editFunctions = array(array("json"));
-               public $operators = array("=", "must", "should", "must_not");
+               public array $editFunctions = array(array("json"));
+               public array $operators = array("=", "must", "should", "must_not");
 
                function __construct(Db $connection) {
                        parent::__construct($connection);
index 6030f05ab39e2d9bc72758bbb6c94e0aca718e4f..75522b8702451e1e6b77a8c42531293271b786fe 100644 (file)
@@ -12,7 +12,7 @@ if (isset($_GET["firebird"])) {
 
        if (extension_loaded("interbase")) {
                class Db extends SqlDb {
-                       public $extension = "Firebird", $_link;
+                       public string $extension = "Firebird", $_link;
 
                        function connect(string $server, string $username, string $password): bool {
                                $this->_link = ibase_connect($server, $username, $password);
@@ -68,7 +68,7 @@ if (isset($_GET["firebird"])) {
                                return ibase_fetch_row($this->result);
                        }
 
-                       function fetch_field(): object {
+                       function fetch_field(): \stdClass {
                                $field = ibase_field_info($this->result, $this->offset++);
                                return (object) array(
                                        'name' => $field['name'],
@@ -87,10 +87,10 @@ if (isset($_GET["firebird"])) {
 
 
        class Driver extends SqlDriver {
-               static $possibleDrivers = array("interbase");
-               static $jush = "firebird";
+               static array $possibleDrivers = array("interbase");
+               static string $jush = "firebird";
 
-               public $operators = array("=");
+               public array $operators = array("=");
        }
 
 
index bde674a5b62e9a27f16fe2a28076c2175030bea6..85357eae6bdb8c1ad9896668ef86c9b69c31b4a6 100644 (file)
@@ -19,7 +19,7 @@ if (isset($_GET["imap"])) {
 
        if (extension_loaded("imap")) {
                class Db extends SqlDb {
-                       public $extension = "IMAP";
+                       public string $extension = "IMAP";
                        public $server_info = "?"; // imap_mailboxmsginfo() or imap_check() don't return anything useful
                        private $mailbox;
                        private $imap;
@@ -134,7 +134,7 @@ if (isset($_GET["imap"])) {
                                return ($row ? array_values($row) : false);
                        }
 
-                       function fetch_field(): object {
+                       function fetch_field(): \stdClass {
                                $field = current($this->fields);
                                next($this->fields);
                                return ($field != '' ? (object) array('name' => $field, 'type' => 15, 'charsetnr' => 0) : false);
@@ -143,9 +143,9 @@ if (isset($_GET["imap"])) {
        }
 
        class Driver extends SqlDriver {
-               static $possibleDrivers = array("imap");
-               static $jush = "imap";
-               public $editFunctions = array(array("json"));
+               static array $possibleDrivers = array("imap");
+               static string $jush = "imap";
+               public array $editFunctions = array(array("json"));
        }
 
        function logged_user() {
index 8b0d74b578b33e3e5175e80b380bcf07ce739fa4..96bda627ef0e36f1e0e90ce3d54b0fad4cba8151 100644 (file)
@@ -8,7 +8,7 @@ if (isset($_GET["mongo"])) {
 
        if (class_exists('MongoDB\Driver\Manager')) {
                class Db extends SqlDb {
-                       public $extension = "MongoDB", $server_info = MONGODB_VERSION, $last_id;
+                       public string $extension = "MongoDB", $server_info = MONGODB_VERSION, $last_id;
                        public \MongoDB\Driver\Manager $_link;
                        public $_db, $_db_name;
 
@@ -118,7 +118,7 @@ if (isset($_GET["mongo"])) {
                                return array_values($return);
                        }
 
-                       function fetch_field(): object {
+                       function fetch_field(): \stdClass {
                                $keys = array_keys($this->rows[0]);
                                $name = $keys[$this->offset++];
                                return (object) array(
@@ -293,12 +293,12 @@ if (isset($_GET["mongo"])) {
 
 
        class Driver extends SqlDriver {
-               static $possibleDrivers = array("mongodb");
-               static $jush = "mongo";
+               static array $possibleDrivers = array("mongodb");
+               static string $jush = "mongo";
 
-               public $editFunctions = array(array("json"));
+               public array $editFunctions = array(array("json"));
 
-               public $operators = array(
+               public array $operators = array(
                        "=",
                        "!=",
                        ">",
index 894452197d352f8d37e372413421ac1d08f9f041..82fa2452d48a521e806c39af2cd3b8f3b2fc9f54 100644 (file)
@@ -8,7 +8,7 @@ if (isset($_GET["simpledb"])) {
 
        if (class_exists('SimpleXMLElement') && ini_bool('allow_url_fopen')) {
                class Db extends SqlDb {
-                       public $extension = "SimpleXML", $server_info = '2009-04-15', $timeout, $next;
+                       public string $extension = "SimpleXML", $server_info = '2009-04-15', $timeout, $next;
 
                        function select_db(string $database): bool {
                                return ($database == "domain");
@@ -97,7 +97,7 @@ if (isset($_GET["simpledb"])) {
                                return array_values($return);
                        }
 
-                       function fetch_field(): object {
+                       function fetch_field(): \stdClass {
                                $keys = array_keys($this->rows[0]);
                                return (object) array('name' => $keys[$this->offset++], 'type' => 15, 'charsetnr' => 0);
                        }
@@ -107,11 +107,11 @@ if (isset($_GET["simpledb"])) {
 
 
        class Driver extends SqlDriver {
-               static $possibleDrivers = array("SimpleXML + allow_url_fopen");
-               static $jush = "simpledb";
+               static array $possibleDrivers = array("SimpleXML + allow_url_fopen");
+               static string $jush = "simpledb";
 
-               public $operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "IS NOT NULL");
-               public $grouping = array("count");
+               public array $operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "IS NOT NULL");
+               public array $grouping = array("count");
 
                public $primary = "itemName()";