1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-06 06:37:33 +02:00

Doc-comments: Fix type errors

This commit is contained in:
Jakub Vrana
2025-03-28 10:25:11 +01:00
parent 54f8d731b3
commit b948f77af4
16 changed files with 97 additions and 89 deletions

View File

@@ -13,7 +13,7 @@ if (isset($_GET["mssql"])) {
define('Adminer\DRIVER', "mssql"); define('Adminer\DRIVER', "mssql");
if (extension_loaded("sqlsrv") && $_GET["ext"] != "pdo") { if (extension_loaded("sqlsrv") && $_GET["ext"] != "pdo") {
class Db extends SqlDb { class Db extends SqlDb {
public $extension = "sqlsrv"; public string $extension = "sqlsrv";
private $link, $result; private $link, $result;
private function get_error() { private function get_error() {
@@ -124,7 +124,7 @@ if (isset($_GET["mssql"])) {
return $this->convert(sqlsrv_fetch_array($this->result, SQLSRV_FETCH_NUMERIC)); return $this->convert(sqlsrv_fetch_array($this->result, SQLSRV_FETCH_NUMERIC));
} }
function fetch_field(): object { function fetch_field(): \stdClass {
if (!$this->fields) { if (!$this->fields) {
$this->fields = sqlsrv_field_metadata($this->result); $this->fields = sqlsrv_field_metadata($this->result);
} }
@@ -180,7 +180,7 @@ if (isset($_GET["mssql"])) {
if (extension_loaded("pdo_sqlsrv")) { if (extension_loaded("pdo_sqlsrv")) {
class Db extends MssqlDb { class Db extends MssqlDb {
public $extension = "PDO_SQLSRV"; public string $extension = "PDO_SQLSRV";
function connect(string $server, string $username, string $password): bool { function connect(string $server, string $username, string $password): bool {
$this->dsn("sqlsrv:Server=" . str_replace(":", ",", $server), $username, $password); $this->dsn("sqlsrv:Server=" . str_replace(":", ",", $server), $username, $password);
@@ -190,7 +190,7 @@ if (isset($_GET["mssql"])) {
} elseif (extension_loaded("pdo_dblib")) { } elseif (extension_loaded("pdo_dblib")) {
class Db extends MssqlDb { class Db extends MssqlDb {
public $extension = "PDO_DBLIB"; public string $extension = "PDO_DBLIB";
function connect(string $server, string $username, string $password): bool { 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); $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 { class Driver extends SqlDriver {
static $possibleDrivers = array("SQLSRV", "PDO_SQLSRV", "PDO_DBLIB"); static array $possibleDrivers = array("SQLSRV", "PDO_SQLSRV", "PDO_DBLIB");
static $jush = "mssql"; static string $jush = "mssql";
public $editFunctions = array( public array $editFunctions = array(
array( array(
"date|time" => "getdate", "date|time" => "getdate",
), array( ), 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 array $operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL");
public $functions = array("len", "lower", "round", "upper"); public array $functions = array("len", "lower", "round", "upper");
public $grouping = array("avg", "count", "count distinct", "max", "min", "sum"); public array $grouping = array("avg", "count", "count distinct", "max", "min", "sum");
public $onActions = "NO ACTION|CASCADE|SET NULL|SET DEFAULT"; public array $generated = array("PERSISTED", "VIRTUAL");
public $generated = array("PERSISTED", "VIRTUAL"); public string $onActions = "NO ACTION|CASCADE|SET NULL|SET DEFAULT";
function __construct(Db $connection) { function __construct(Db $connection) {
parent::__construct($connection); parent::__construct($connection);

View 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 // MySQLi supports everything, MySQL doesn't support multiple result sets, PDO_MySQL doesn't support orgtable
if (extension_loaded("mysqli") && $_GET["ext"] != "pdo") { if (extension_loaded("mysqli") && $_GET["ext"] != "pdo") {
class Db extends \MySQLi { class Db extends \MySQLi {
public $extension = "MySQLi", $flavor = ''; public string $extension = "MySQLi", $flavor = '';
function __construct() { function __construct() {
parent::init(); 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"))) { } elseif (extension_loaded("mysql") && !((ini_bool("sql.safe_mode") || ini_bool("mysql.allow_local_infile")) && extension_loaded("pdo_mysql"))) {
class Db extends SqlDb { class Db extends SqlDb {
private resource $link; /** @var resource */ private $link;
function connect(string $server, string $username, string $password): bool { function connect(string $server, string $username, string $password): bool {
if (ini_bool("mysql.allow_local_infile")) { if (ini_bool("mysql.allow_local_infile")) {
@@ -122,10 +122,11 @@ if (!defined('Adminer\DRIVER')) {
class Result { class Result {
public int $num_rows; // number of rows in the result public int $num_rows; // number of rows in the result
private resource $result; /** @var resource */ private $result;
private int $offset = 0; private int $offset = 0;
function __construct(resource $result) { /** @param resource $result */
function __construct($result) {
$this->result = $result; $this->result = $result;
$this->num_rows = mysql_num_rows($result); $this->num_rows = mysql_num_rows($result);
} }
@@ -145,9 +146,9 @@ if (!defined('Adminer\DRIVER')) {
} }
/** Fetch next field /** 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 = mysql_fetch_field($this->result, $this->offset++); // offset required under certain conditions
$return->orgtable = $return->table; $return->orgtable = $return->table;
$return->charsetnr = ($return->blob ? 63 : 0); $return->charsetnr = ($return->blob ? 63 : 0);
@@ -162,7 +163,7 @@ if (!defined('Adminer\DRIVER')) {
} elseif (extension_loaded("pdo_mysql")) { } elseif (extension_loaded("pdo_mysql")) {
class Db extends PdoDb { class Db extends PdoDb {
public $extension = "PDO_MySQL"; public string $extension = "PDO_MySQL";
function connect(string $server, string $username, string $password): bool { function connect(string $server, string $username, string $password): bool {
global $adminer; global $adminer;

View File

@@ -7,7 +7,7 @@ if (isset($_GET["oracle"])) {
define('Adminer\DRIVER', "oracle"); define('Adminer\DRIVER', "oracle");
if (extension_loaded("oci8") && $_GET["ext"] != "pdo") { if (extension_loaded("oci8") && $_GET["ext"] != "pdo") {
class Db extends SqlDb { class Db extends SqlDb {
public $extension = "oci8"; public string $extension = "oci8";
public $_current_db; public $_current_db;
private $link; private $link;
@@ -87,7 +87,7 @@ if (isset($_GET["oracle"])) {
return $this->convert(oci_fetch_row($this->result)); return $this->convert(oci_fetch_row($this->result));
} }
function fetch_field(): object { function fetch_field(): \stdClass {
$column = $this->offset++; $column = $this->offset++;
$return = new \stdClass; $return = new \stdClass;
$return->name = oci_field_name($this->result, $column); $return->name = oci_field_name($this->result, $column);
@@ -103,7 +103,7 @@ if (isset($_GET["oracle"])) {
} elseif (extension_loaded("pdo_oci")) { } elseif (extension_loaded("pdo_oci")) {
class Db extends PdoDb { class Db extends PdoDb {
public $extension = "PDO_OCI"; public string $extension = "PDO_OCI";
public $_current_db; public $_current_db;
function connect(string $server, string $username, string $password): bool { function connect(string $server, string $username, string $password): bool {
@@ -122,10 +122,10 @@ if (isset($_GET["oracle"])) {
class Driver extends SqlDriver { class Driver extends SqlDriver {
static $possibleDrivers = array("OCI8", "PDO_OCI"); static array $possibleDrivers = array("OCI8", "PDO_OCI");
static $jush = "oracle"; static string $jush = "oracle";
public $editFunctions = array( public array $editFunctions = array(
array( //! no parentheses array( //! no parentheses
"date" => "current_date", "date" => "current_date",
"timestamp" => "current_timestamp", "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 array $operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL", "SQL");
public $functions = array("length", "lower", "round", "upper"); public array $functions = array("length", "lower", "round", "upper");
public $grouping = array("avg", "count", "count distinct", "max", "min", "sum"); public array $grouping = array("avg", "count", "count distinct", "max", "min", "sum");
function __construct(Db $connection) { function __construct(Db $connection) {
parent::__construct($connection); parent::__construct($connection);

View File

@@ -7,7 +7,8 @@ if (isset($_GET["pgsql"])) {
define('Adminer\DRIVER', "pgsql"); define('Adminer\DRIVER', "pgsql");
if (extension_loaded("pgsql") && $_GET["ext"] != "pdo") { if (extension_loaded("pgsql") && $_GET["ext"] != "pdo") {
class Db extends SqlDb { class Db extends SqlDb {
public $extension = "PgSQL", $timeout; public string $extension = "PgSQL";
public int $timeout;
private $link, $string, $database = true; private $link, $string, $database = true;
function _error($errno, $error) { function _error($errno, $error) {
@@ -108,7 +109,7 @@ if (isset($_GET["pgsql"])) {
return pg_fetch_row($this->result); return pg_fetch_row($this->result);
} }
function fetch_field(): object { function fetch_field(): \stdClass {
$column = $this->offset++; $column = $this->offset++;
$return = new \stdClass; $return = new \stdClass;
$return->orgtable = pg_field_table($this->result, $column); $return->orgtable = pg_field_table($this->result, $column);
@@ -125,7 +126,8 @@ if (isset($_GET["pgsql"])) {
} elseif (extension_loaded("pdo_pgsql")) { } elseif (extension_loaded("pdo_pgsql")) {
class Db extends PdoDb { 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 { function connect(string $server, string $username, string $password): bool {
global $adminer; global $adminer;
@@ -167,12 +169,12 @@ if (isset($_GET["pgsql"])) {
class Driver extends SqlDriver { class Driver extends SqlDriver {
static $possibleDrivers = array("PgSQL", "PDO_PgSQL"); static array $possibleDrivers = array("PgSQL", "PDO_PgSQL");
static $jush = "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 array $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 array $functions = array("char_length", "lower", "round", "to_hex", "to_timestamp", "upper");
public $grouping = array("avg", "count", "count distinct", "max", "min", "sum"); public array $grouping = array("avg", "count", "count distinct", "max", "min", "sum");
function __construct(Db $connection) { function __construct(Db $connection) {
parent::__construct($connection); parent::__construct($connection);

View File

@@ -8,7 +8,7 @@ if (isset($_GET["sqlite"])) {
if (class_exists("SQLite3") && $_GET["ext"] != "pdo") { if (class_exists("SQLite3") && $_GET["ext"] != "pdo") {
abstract class SqliteDb extends SqlDb { abstract class SqliteDb extends SqlDb {
public $extension = "SQLite3"; public string $extension = "SQLite3";
private $link; private $link;
function connect(string $filename, string $username = '', string $password = ''): bool { function connect(string $filename, string $username = '', string $password = ''): bool {
@@ -56,7 +56,7 @@ if (isset($_GET["sqlite"])) {
return $this->result->fetchArray(SQLITE3_NUM); return $this->result->fetchArray(SQLITE3_NUM);
} }
function fetch_field(): object { function fetch_field(): \stdClass {
$column = $this->offset++; $column = $this->offset++;
$type = $this->result->columnType($column); $type = $this->result->columnType($column);
return (object) array( return (object) array(
@@ -73,7 +73,7 @@ if (isset($_GET["sqlite"])) {
} elseif (extension_loaded("pdo_sqlite")) { } elseif (extension_loaded("pdo_sqlite")) {
abstract class SqliteDb extends PdoDb { abstract class SqliteDb extends PdoDb {
public $extension = "PDO_SQLite"; public string $extension = "PDO_SQLite";
function connect(string $filename, string $username = '', string $password = ''): bool { function connect(string $filename, string $username = '', string $password = ''): bool {
$this->dsn(DRIVER . ":$filename", "", ""); $this->dsn(DRIVER . ":$filename", "", "");
@@ -106,12 +106,12 @@ if (isset($_GET["sqlite"])) {
class Driver extends SqlDriver { class Driver extends SqlDriver {
static $possibleDrivers = array("SQLite3", "PDO_SQLite"); static array $possibleDrivers = array("SQLite3", "PDO_SQLite");
static $jush = "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( array(
// "text" => "date('now')/time('now')/datetime('now')", // "text" => "date('now')/time('now')/datetime('now')",
), array( ), 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 array $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 array $functions = array("hex", "length", "lower", "round", "unixepoch", "upper");
public $grouping = array("avg", "count", "count distinct", "group_concat", "max", "min", "sum"); public array $grouping = array("avg", "count", "count distinct", "group_concat", "max", "min", "sum");
function __construct(Db $connection) { function __construct(Db $connection) {
parent::__construct($connection); parent::__construct($connection);

View File

@@ -361,7 +361,7 @@ function edit_fields(array $fields, array $collations, $type = "TABLE", array $f
/** Move fields up and down or add field /** Move fields up and down or add field
* @param Field[] $fields * @param Field[] $fields
*/ */
function process_fields(&array $fields): bool { function process_fields(array &$fields): bool {
$offset = 0; $offset = 0;
if ($_POST["up"]) { if ($_POST["up"]) {
$last = 0; $last = 0;

View File

@@ -476,7 +476,7 @@ function queries(string $query) {
* @param list<string> $tables * @param list<string> $tables
* @param callable(string):string $escape * @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) { foreach ($tables as $table) {
if (!queries("$query " . $escape($table))) { if (!queries("$query " . $escape($table))) {
return false; return false;
@@ -712,16 +712,20 @@ function file_open_lock(string $filename) {
return $fp; return $fp;
} }
/** Write and unlock a file */ /** Write and unlock a file
function file_write_unlock(resource $fp, string $data): void { * @param resource $fp
*/
function file_write_unlock($fp, string $data): void {
rewind($fp); rewind($fp);
fwrite($fp, $data); fwrite($fp, $data);
ftruncate($fp, strlen($data)); ftruncate($fp, strlen($data));
file_unlock($fp); file_unlock($fp);
} }
/** Unlock and close a file */ /** Unlock and close a file
function file_unlock(resource $fp): void { * @param resource $fp
*/
function file_unlock($fp): void {
flock($fp, LOCK_UN); flock($fp, LOCK_UN);
fclose($fp); fclose($fp);
} }

View File

@@ -76,7 +76,7 @@ if (extension_loaded('pdo')) {
return $this->fetch(\PDO::FETCH_NUM); return $this->fetch(\PDO::FETCH_NUM);
} }
function fetch_field(): object { function fetch_field(): \stdClass {
$row = (object) $this->getColumnMeta($this->_offset++); $row = (object) $this->getColumnMeta($this->_offset++);
$type = $row->pdo_type; $type = $row->pdo_type;
$row->type = ($type == \PDO::PARAM_INT ? 0 : 15); $row->type = ($type == \PDO::PARAM_INT ? 0 : 15);

View File

@@ -2,7 +2,7 @@
namespace Adminer; namespace Adminer;
class TmpFile { class TmpFile {
private resource $handler; /** @var resource */ private $handler;
/** @visibility protected(set) */ public int $size; /** @visibility protected(set) */ public int $size;
function __construct() { function __construct() {

View File

@@ -24,7 +24,7 @@ parameters:
paths: paths:
- adminer/include/pdo.inc.php - adminer/include/pdo.inc.php
- adminer/drivers/* - adminer/drivers/*
- -
message: "~ to an undefined ~" # PostgreSQL has this in its version of Db message: "~ to an undefined ~" # PostgreSQL has this in its version of Db
path: adminer/drivers/pgsql.inc.php path: adminer/drivers/pgsql.inc.php
@@ -52,6 +52,7 @@ parameters:
scanFiles: scanFiles:
- compile.php # compile_file() - compile.php # compile_file()
excludePaths: excludePaths:
- adminer/adminer-plugins/
- adminer/lang/ - adminer/lang/
- adminer/adminer-plugins.php - adminer/adminer-plugins.php
- adminer/designs.php - adminer/designs.php
@@ -59,7 +60,7 @@ parameters:
- adminer/sqlite.php - adminer/sqlite.php
phpVersion: phpVersion:
min: 70100 min: 70400
max: 80499 max: 80499
typeAliases: typeAliases:

View File

@@ -8,7 +8,7 @@ if (isset($_GET["clickhouse"])) {
if (ini_bool('allow_url_fopen')) { if (ini_bool('allow_url_fopen')) {
class Db extends SqlDb { class Db extends SqlDb {
public $extension = "JSON"; public string $extension = "JSON";
public $_db = 'default'; public $_db = 'default';
private $url; private $url;
@@ -103,7 +103,7 @@ if (isset($_GET["clickhouse"])) {
return $row; return $row;
} }
function fetch_field(): object { function fetch_field(): \stdClass {
$column = $this->offset++; $column = $this->offset++;
$return = new \stdClass; $return = new \stdClass;
if ($column < count($this->columns)) { if ($column < count($this->columns)) {
@@ -117,11 +117,11 @@ if (isset($_GET["clickhouse"])) {
} }
class Driver extends SqlDriver { class Driver extends SqlDriver {
static $possibleDrivers = array("allow_url_fopen"); static array $possibleDrivers = array("allow_url_fopen");
static $jush = "clickhouse"; static string $jush = "clickhouse";
public $operators = array("=", "<", ">", "<=", ">=", "!=", "~", "!~", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL", "SQL"); public array $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 $grouping = array("avg", "count", "count distinct", "max", "min", "sum");
function __construct(Db $connection) { function __construct(Db $connection) {
parent::__construct($connection); parent::__construct($connection);

View File

@@ -9,7 +9,7 @@ if (isset($_GET["elastic"])) {
if (ini_bool('allow_url_fopen')) { if (ini_bool('allow_url_fopen')) {
class Db extends SqlDb { class Db extends SqlDb {
public $extension = "JSON"; public string $extension = "JSON";
private $url; private $url;
/** /**
@@ -108,11 +108,11 @@ if (isset($_GET["elastic"])) {
} }
class Driver extends SqlDriver { class Driver extends SqlDriver {
static $possibleDrivers = array("json + allow_url_fopen"); static array $possibleDrivers = array("json + allow_url_fopen");
static $jush = "elastic"; static string $jush = "elastic";
public $editFunctions = array(array("json")); public array $editFunctions = array(array("json"));
public $operators = array("=", "must", "should", "must_not"); public array $operators = array("=", "must", "should", "must_not");
function __construct(Db $connection) { function __construct(Db $connection) {
parent::__construct($connection); parent::__construct($connection);

View File

@@ -12,7 +12,7 @@ if (isset($_GET["firebird"])) {
if (extension_loaded("interbase")) { if (extension_loaded("interbase")) {
class Db extends SqlDb { class Db extends SqlDb {
public $extension = "Firebird", $_link; public string $extension = "Firebird", $_link;
function connect(string $server, string $username, string $password): bool { function connect(string $server, string $username, string $password): bool {
$this->_link = ibase_connect($server, $username, $password); $this->_link = ibase_connect($server, $username, $password);
@@ -68,7 +68,7 @@ if (isset($_GET["firebird"])) {
return ibase_fetch_row($this->result); return ibase_fetch_row($this->result);
} }
function fetch_field(): object { function fetch_field(): \stdClass {
$field = ibase_field_info($this->result, $this->offset++); $field = ibase_field_info($this->result, $this->offset++);
return (object) array( return (object) array(
'name' => $field['name'], 'name' => $field['name'],
@@ -87,10 +87,10 @@ if (isset($_GET["firebird"])) {
class Driver extends SqlDriver { class Driver extends SqlDriver {
static $possibleDrivers = array("interbase"); static array $possibleDrivers = array("interbase");
static $jush = "firebird"; static string $jush = "firebird";
public $operators = array("="); public array $operators = array("=");
} }

View File

@@ -19,7 +19,7 @@ if (isset($_GET["imap"])) {
if (extension_loaded("imap")) { if (extension_loaded("imap")) {
class Db extends SqlDb { class Db extends SqlDb {
public $extension = "IMAP"; public string $extension = "IMAP";
public $server_info = "?"; // imap_mailboxmsginfo() or imap_check() don't return anything useful public $server_info = "?"; // imap_mailboxmsginfo() or imap_check() don't return anything useful
private $mailbox; private $mailbox;
private $imap; private $imap;
@@ -134,7 +134,7 @@ if (isset($_GET["imap"])) {
return ($row ? array_values($row) : false); return ($row ? array_values($row) : false);
} }
function fetch_field(): object { function fetch_field(): \stdClass {
$field = current($this->fields); $field = current($this->fields);
next($this->fields); next($this->fields);
return ($field != '' ? (object) array('name' => $field, 'type' => 15, 'charsetnr' => 0) : false); return ($field != '' ? (object) array('name' => $field, 'type' => 15, 'charsetnr' => 0) : false);
@@ -143,9 +143,9 @@ if (isset($_GET["imap"])) {
} }
class Driver extends SqlDriver { class Driver extends SqlDriver {
static $possibleDrivers = array("imap"); static array $possibleDrivers = array("imap");
static $jush = "imap"; static string $jush = "imap";
public $editFunctions = array(array("json")); public array $editFunctions = array(array("json"));
} }
function logged_user() { function logged_user() {

View File

@@ -8,7 +8,7 @@ if (isset($_GET["mongo"])) {
if (class_exists('MongoDB\Driver\Manager')) { if (class_exists('MongoDB\Driver\Manager')) {
class Db extends SqlDb { 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 \MongoDB\Driver\Manager $_link;
public $_db, $_db_name; public $_db, $_db_name;
@@ -118,7 +118,7 @@ if (isset($_GET["mongo"])) {
return array_values($return); return array_values($return);
} }
function fetch_field(): object { function fetch_field(): \stdClass {
$keys = array_keys($this->rows[0]); $keys = array_keys($this->rows[0]);
$name = $keys[$this->offset++]; $name = $keys[$this->offset++];
return (object) array( return (object) array(
@@ -293,12 +293,12 @@ if (isset($_GET["mongo"])) {
class Driver extends SqlDriver { class Driver extends SqlDriver {
static $possibleDrivers = array("mongodb"); static array $possibleDrivers = array("mongodb");
static $jush = "mongo"; static string $jush = "mongo";
public $editFunctions = array(array("json")); public array $editFunctions = array(array("json"));
public $operators = array( public array $operators = array(
"=", "=",
"!=", "!=",
">", ">",

View File

@@ -8,7 +8,7 @@ if (isset($_GET["simpledb"])) {
if (class_exists('SimpleXMLElement') && ini_bool('allow_url_fopen')) { if (class_exists('SimpleXMLElement') && ini_bool('allow_url_fopen')) {
class Db extends SqlDb { 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 { function select_db(string $database): bool {
return ($database == "domain"); return ($database == "domain");
@@ -97,7 +97,7 @@ if (isset($_GET["simpledb"])) {
return array_values($return); return array_values($return);
} }
function fetch_field(): object { function fetch_field(): \stdClass {
$keys = array_keys($this->rows[0]); $keys = array_keys($this->rows[0]);
return (object) array('name' => $keys[$this->offset++], 'type' => 15, 'charsetnr' => 0); return (object) array('name' => $keys[$this->offset++], 'type' => 15, 'charsetnr' => 0);
} }
@@ -107,11 +107,11 @@ if (isset($_GET["simpledb"])) {
class Driver extends SqlDriver { class Driver extends SqlDriver {
static $possibleDrivers = array("SimpleXML + allow_url_fopen"); static array $possibleDrivers = array("SimpleXML + allow_url_fopen");
static $jush = "simpledb"; static string $jush = "simpledb";
public $operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "IS NOT NULL"); public array $operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "IS NOT NULL");
public $grouping = array("count"); public array $grouping = array("count");
public $primary = "itemName()"; public $primary = "itemName()";