1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-08 23:57:29 +02:00

Doc-comments: Move return types to declaration

This commit is contained in:
Jakub Vrana
2025-03-28 09:03:09 +01:00
parent 641ee4ff26
commit 45c045382a
21 changed files with 277 additions and 456 deletions

View File

@@ -66,9 +66,8 @@ if (isset($_GET["elastic"])) {
}
/**
* @return bool
*/
function connect(string $server, string $username, string $password) {
function connect(string $server, string $username, string $password): bool {
preg_match('~^(https?://)?(.*)~', $server, $match);
$this->url = ($match[1] ?: "http://") . urlencode($username) . ":" . urlencode($password) . "@$match[2]";
$return = $this->query('');
@@ -543,9 +542,8 @@ if (isset($_GET["elastic"])) {
/** Drop types
* @param list<string> $tables
* @return bool
*/
function drop_tables(array $tables) {
function drop_tables(array $tables): bool {
$return = true;
foreach ($tables as $table) { //! convert to bulk api
$return = $return && connection()->query(urlencode($table), null, 'DELETE');

View File

@@ -10,9 +10,8 @@ class AdminerTableIndexesStructure {
/** Print table structure in tabular format
* @param Index[] $indexes data about all indexes on a table
* @return bool
*/
function tableIndexesPrint(array $indexes) {
function tableIndexesPrint(array $indexes): bool {
echo "<table>\n";
echo "<thead><tr><th>" . Adminer\lang('Name') . "<th>" . Adminer\lang('Type') . "<th>" . Adminer\lang('Columns') . "</thead>\n";
foreach ($indexes as $name => $index) {

View File

@@ -10,9 +10,8 @@ class AdminerTableStructure {
/** Print table structure in tabular format
* @param Field[] $fields data about individual fields
* @return bool
*/
function tableStructurePrint(array $fields, $tableStatus = null) {
function tableStructurePrint(array $fields, $tableStatus = null): bool {
echo "<div class='scrollable'>\n";
echo "<table class='nowrap odds'>\n";
echo "<thead><tr>"