1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-08 07:36:44 +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

@@ -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);

View 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);

View 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("=");
}

View 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() {

View 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(
"=",
"!=",
">",

View 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()";