1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-11 09:04:02 +02:00

Doc-comments: Fix type errors

This commit is contained in:
Jakub Vrana
2025-03-28 13:15:14 +01:00
parent dc38a7ded3
commit 46f6a96c95
22 changed files with 60 additions and 64 deletions

View File

@@ -116,11 +116,11 @@ if (isset($_GET["mssql"])) {
return $row;
}
function fetch_assoc(): array {
function fetch_assoc() {
return $this->convert(sqlsrv_fetch_array($this->result, SQLSRV_FETCH_ASSOC));
}
function fetch_row(): array {
function fetch_row() {
return $this->convert(sqlsrv_fetch_array($this->result, SQLSRV_FETCH_NUMERIC));
}

View File

@@ -132,16 +132,16 @@ if (!defined('Adminer\DRIVER')) {
}
/** Fetch next row as associative array
* @return array<?string>
* @return array<?string>|false
*/
function fetch_assoc(): array {
function fetch_assoc() {
return mysql_fetch_assoc($this->result);
}
/** Fetch next row as numbered array
* @return list<?string>
* @return list<?string>|false
*/
function fetch_row(): array {
function fetch_row() {
return mysql_fetch_row($this->result);
}
@@ -623,7 +623,7 @@ if (!defined('Adminer\DRIVER')) {
}
/** Find out if database is information_schema */
function information_schema(string $db): bool {
function information_schema(?string $db): bool {
return ($db == "information_schema")
|| (min_version(5.5) && $db == "performance_schema");
}
@@ -951,7 +951,7 @@ if (!defined('Adminer\DRIVER')) {
}
/** Get SQL command to create table */
function create_sql(string $table, bool $auto_increment, string $style): string {
function create_sql(string $table, ?bool $auto_increment, string $style): string {
$return = get_val("SHOW CREATE TABLE " . table($table), 1);
if (!$auto_increment) {
$return = preg_replace('~ AUTO_INCREMENT=\d+~', '', $return); //! skip comments

View File

@@ -79,11 +79,11 @@ if (isset($_GET["oracle"])) {
return $row;
}
function fetch_assoc(): array {
function fetch_assoc() {
return $this->convert(oci_fetch_assoc($this->result));
}
function fetch_row(): array {
function fetch_row() {
return $this->convert(oci_fetch_row($this->result));
}

View File

@@ -101,11 +101,11 @@ if (isset($_GET["pgsql"])) {
$this->num_rows = pg_num_rows($result);
}
function fetch_assoc(): array {
function fetch_assoc() {
return pg_fetch_assoc($this->result);
}
function fetch_row(): array {
function fetch_row() {
return pg_fetch_row($this->result);
}

View File

@@ -48,11 +48,11 @@ if (isset($_GET["sqlite"])) {
$this->result = $result;
}
function fetch_assoc(): array {
function fetch_assoc() {
return $this->result->fetchArray(SQLITE3_ASSOC);
}
function fetch_row(): array {
function fetch_row() {
return $this->result->fetchArray(SQLITE3_NUM);
}