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

Doc-comments: Remove redundant info

This commit is contained in:
Jakub Vrana
2025-03-28 12:03:56 +01:00
parent a9143ccbdc
commit e3a4a214e6
8 changed files with 32 additions and 34 deletions

View File

@@ -490,7 +490,7 @@ if (!defined('Adminer\DRIVER')) {
}
/** Check if table supports foreign keys
* @param TableStatus $table_status result of table_status1()
* @param TableStatus $table_status
*/
function fk_support(array $table_status): bool {
return preg_match('~InnoDB|IBMDB2I' . (min_version(5.6) ? '|NDB' : '') . '~i', $table_status["Engine"]);
@@ -872,7 +872,7 @@ if (!defined('Adminer\DRIVER')) {
* @param 'FUNCTION'|'PROCEDURE' $type
* @return Routine
*/
function routine(string $name, $type): array {
function routine(string $name, string $type): array {
global $driver;
$aliases = array("bool", "boolean", "integer", "double precision", "real", "dec", "numeric", "fixed", "national char", "national varchar");
$space = "(?:\\s|/\\*[\s\S]*?\\*/|(?:#|-- )[^\n]*\n?|--\r?\n)";
@@ -921,7 +921,7 @@ if (!defined('Adminer\DRIVER')) {
}
/** Get routine signature
* @param Routine $row result of routine()
* @param Routine $row
*/
function routine_id(string $name, array $row): string {
return idf_escape($name);
@@ -1000,7 +1000,7 @@ if (!defined('Adminer\DRIVER')) {
}
/** Convert field in select and edit
* @param Field $field one element from fields()
* @param Field $field
* @return string|void
*/
function convert_field(array $field) {
@@ -1016,7 +1016,7 @@ if (!defined('Adminer\DRIVER')) {
}
/** Convert value in edit after applying functions back
* @param Field $field one element from fields()
* @param Field $field
* @param string $return SQL expression
*/
function unconvert_field(array $field, string $return): string {

View File

@@ -144,7 +144,7 @@ class Adminer {
}
/** Table caption used in navigation and headings
* @param TableStatus $tableStatus result of table_status1()
* @param TableStatus $tableStatus
* @return string HTML code, "" to ignore table
*/
function tableName(array $tableStatus): string {
@@ -152,7 +152,7 @@ class Adminer {
}
/** Field caption used in select and edit
* @param Field $field single field returned from fields()
* @param Field $field
* @param int $order order of column in select
* @return string HTML code, "" to ignore field
*/
@@ -163,7 +163,7 @@ class Adminer {
}
/** Print links after select heading
* @param TableStatus $tableStatus result of table_status1()
* @param TableStatus $tableStatus
* @param ?string $set new item options, NULL for no new item
*/
function selectLinks(array $tableStatus, ?string $set = ""): void {
@@ -208,7 +208,7 @@ class Adminer {
}
/** Print backward keys for row
* @param BackwardKey[] $backwardKeys result of $this->backwardKeys()
* @param BackwardKey[] $backwardKeys
* @param string[] $row
*/
function backwardKeysPrint(array $backwardKeys, array $row): void {
@@ -263,7 +263,7 @@ class Adminer {
/** Get a link to use in select table
* @param string $val raw value of the field
* @param Field $field single field returned from fields()
* @param Field $field
* @return string|void null to create the default link
*/
function selectLink(?string $val, array $field) {
@@ -272,7 +272,7 @@ class Adminer {
/** Value printed in select table
* @param ?string $val HTML-escaped value to print
* @param ?string $link link to foreign key
* @param Field $field single field returned from fields()
* @param Field $field
* @param string $original original value before applying editVal() and escaping
*/
function selectVal(?string $val, ?string $link, array $field, ?string $original): string {
@@ -288,14 +288,14 @@ class Adminer {
}
/** Value conversion used in select and edit
* @param Field $field single field returned from fields()
* @param Field $field
*/
function editVal(?string $val, array $field): ?string {
return $val;
}
/** Print table structure in tabular format
* @param Field[] $fields data about individual fields
* @param Field[] $fields
* @param TableStatus $tableStatus
*/
function tableStructurePrint(array $fields, array $tableStatus = null): void {
@@ -326,7 +326,7 @@ class Adminer {
}
/** Print list of indexes on table in tabular format
* @param Index[] $indexes data about all indexes on a table
* @param Index[] $indexes
*/
function tableIndexesPrint(array $indexes): void {
echo "<table>\n";
@@ -657,7 +657,7 @@ class Adminer {
}
/** Functions displayed in edit form
* @param Field $field single field from fields()
* @param Field $field
* @return list<string>
*/
function editFunctions(array $field): array {
@@ -683,8 +683,7 @@ class Adminer {
}
/** Get options to display edit field
* @param string $table table name
* @param Field $field single field from fields()
* @param Field $field
* @param string $attrs attributes to use inside the tag
* @return string custom input field or empty string for default
*/
@@ -699,15 +698,14 @@ class Adminer {
}
/** Get hint for edit field
* @param string $table table name
* @param Field $field single field from fields()
* @param Field $field
*/
function editHint(string $table, array $field, ?string $value): string {
return "";
}
/** Process sent input
* @param Field $field single field from fields()
* @param Field $field
* @return string expression to use in a query
*/
function processInput(array $field, string $value, ?string $function = ""): string {
@@ -995,7 +993,7 @@ class Adminer {
}
/** Set up syntax highlight for code and <textarea>
* @param TableStatus[] $tables result of table_status('', true)
* @param TableStatus[] $tables
*/
function syntaxHighlighting(array $tables): void {
global $connection;
@@ -1057,7 +1055,7 @@ class Adminer {
}
/** Print table list in menu
* @param TableStatus[] $tables result of table_status('', true)
* @param TableStatus[] $tables
*/
function tablesPrint(array $tables): void {
global $adminer;

View File

@@ -189,7 +189,7 @@ function page_messages(string $error): void {
}
/** Print HTML footer
* @param string $missing "auth", "db", "ns"
* @param ''|'auth'|'db'|'ns' $missing
*/
function page_footer(string $missing = ""): void {
global $adminer;

View File

@@ -227,7 +227,7 @@ abstract class SqlDriver {
}
/** Check whether table supports indexes
* @param TableStatus $table_status result of table_status1()
* @param TableStatus $table_status
*/
function supportsIndex(array $table_status): bool {
return !is_view($table_status);

View File

@@ -408,7 +408,7 @@ function normalize_enum(array $match): string {
}
/** Issue grant or revoke commands
* @param string $grant GRANT or REVOKE
* @param 'GRANT'|'REVOKE' $grant
* @param list<string> $privileges
* @return Result|bool
*/
@@ -455,7 +455,7 @@ function drop_create(string $drop, string $create, string $drop_created, string
}
/** Generate SQL query for creating trigger
* @param Trigger $row result of trigger()
* @param Trigger $row
*/
function create_trigger(string $on, array $row): string {
$timing_event = " $row[Timing] $row[Event]" . (preg_match('~ OF~', $row["Event"]) ? " $row[Of]" : ""); // SQL injection
@@ -469,7 +469,7 @@ function create_trigger(string $on, array $row): string {
/** Generate SQL query for creating routine
* @param 'PROCEDURE'|'FUNCTION' $routine
* @param Routine $row result of routine()
* @param Routine $row
*/
function create_routine($routine, array $row): string {
global $driver;

View File

@@ -229,7 +229,7 @@ function get_rows(string $query, Db $connection2 = null, string $error = "<p cla
/** Find unique identifier of a row
* @param string[] $row
* @param Index[] $indexes result of indexes()
* @param Index[] $indexes
* @return string[]|void null if there is no unique identifier
*/
function unique_array(?array $row, array $indexes) {
@@ -416,9 +416,9 @@ function is_ajax(): bool {
}
/** Send Location header and exit
* @param string $location null to only set a message
* @param ?string $location null to only set a message
*/
function redirect(string $location, string $message = null): void {
function redirect(?string $location, string $message = null): void {
if ($message !== null) {
restart_session();
$_SESSION["messages"][preg_replace('~^[^?]*~', '', ($location !== null ? $location : $_SERVER["REQUEST_URI"]))][] = $message;

View File

@@ -171,7 +171,7 @@ function hidden_fields_get(): void {
}
/** Print enum or set input field
* @param string $type "radio"|"checkbox"
* @param 'radio'|'checkbox' $type
* @param Field $field
* @param mixed $value string|array
*/
@@ -188,7 +188,7 @@ function enum_input(string $type, string $attrs, array $field, $value, string $e
}
/** Print edit input field
* @param Field|RoutineField $field one field from fields()
* @param Field|RoutineField $field
* @param mixed $value
*/
function input(array $field, $value, string $function, bool $autofocus = false): void {
@@ -282,7 +282,7 @@ function input(array $field, $value, string $function, bool $autofocus = false):
}
/** Process edit input field
* @param Field|RoutineField $field one field from fields()
* @param Field|RoutineField $field
* @return mixed false to leave the original value
*/
function process_input(array $field) {

View File

@@ -10,7 +10,7 @@ class AdminerLoginPasswordLess {
protected $password_hash;
/** Set allowed password
* @param string $password_hash result of password_hash
* @param string $password_hash result of password_hash()
*/
function __construct(string $password_hash) {
$this->password_hash = $password_hash;