From 94a4f61db2cfc70f36c4c6c24670b62c49e4c118 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Thu, 6 Mar 2025 18:12:22 +0100 Subject: [PATCH] PHP: Use ?: --- adminer/call.inc.php | 2 +- adminer/drivers/mysql.inc.php | 4 ++-- adminer/drivers/oracle.inc.php | 6 +++--- adminer/include/auth.inc.php | 2 +- adminer/include/design.inc.php | 2 +- adminer/include/functions.inc.php | 4 ++-- adminer/include/lang.inc.php | 2 +- adminer/indexes.inc.php | 2 +- adminer/procedure.inc.php | 2 +- adminer/schema.inc.php | 4 ++-- adminer/select.inc.php | 2 +- compile.php | 2 +- lang.php | 2 +- plugins/drivers/clickhouse.php | 2 +- plugins/drivers/elastic.php | 4 ++-- plugins/drivers/elastic5.php | 4 ++-- plugins/drivers/simpledb.php | 2 +- 17 files changed, 24 insertions(+), 24 deletions(-) diff --git a/adminer/call.inc.php b/adminer/call.inc.php index 8262e6a2..33f4cd78 100644 --- a/adminer/call.inc.php +++ b/adminer/call.inc.php @@ -1,7 +1,7 @@ idf_unescape($match[4] != "" ? $match[4] : $match[3]), "source" => array_map('Adminer\idf_unescape', $source[0]), "target" => array_map('Adminer\idf_unescape', $target[0]), - "on_delete" => ($match[6] ? $match[6] : "RESTRICT"), - "on_update" => ($match[7] ? $match[7] : "RESTRICT"), + "on_delete" => ($match[6] ?: "RESTRICT"), + "on_update" => ($match[7] ?: "RESTRICT"), ); } } diff --git a/adminer/drivers/oracle.inc.php b/adminer/drivers/oracle.inc.php index 518f217e..009c8a99 100644 --- a/adminer/drivers/oracle.inc.php +++ b/adminer/drivers/oracle.inc.php @@ -258,7 +258,7 @@ ORDER BY 1" function get_current_db() { global $connection; - $db = $connection->_current_db ? $connection->_current_db : DB; + $db = $connection->_current_db ?: DB; unset($connection->_current_db); return $db; } @@ -272,7 +272,7 @@ ORDER BY 1" function views_table($columns) { $owner = where_owner(''); - return "(SELECT $columns FROM all_views WHERE " . ($owner ? $owner : "rownum < 0") . ")"; + return "(SELECT $columns FROM all_views WHERE " . ($owner ?: "rownum < 0") . ")"; } function tables_list() { @@ -503,7 +503,7 @@ AND c_src.TABLE_NAME = " . q($table); function schemas() { $return = get_vals("SELECT DISTINCT owner FROM dba_segments WHERE owner IN (SELECT username FROM dba_users WHERE default_tablespace NOT IN ('SYSTEM','SYSAUX')) ORDER BY 1"); - return ($return ? $return : get_vals("SELECT DISTINCT owner FROM all_tables WHERE tablespace_name = " . q(DB) . " ORDER BY 1")); + return ($return ?: get_vals("SELECT DISTINCT owner FROM all_tables WHERE tablespace_name = " . q(DB) . " ORDER BY 1")); } function get_schema() { diff --git a/adminer/include/auth.inc.php b/adminer/include/auth.inc.php index 48602037..965b54f8 100644 --- a/adminer/include/auth.inc.php +++ b/adminer/include/auth.inc.php @@ -133,7 +133,7 @@ function auth_error($error) { $error = lang('Session support must be enabled.'); } $params = session_get_cookie_params(); - cookie("adminer_key", ($_COOKIE["adminer_key"] ? $_COOKIE["adminer_key"] : rand_string()), $params["lifetime"]); + cookie("adminer_key", ($_COOKIE["adminer_key"] ?: rand_string()), $params["lifetime"]); page_header(lang('Login'), $error, null); echo "
\n"; echo "
"; diff --git a/adminer/include/design.inc.php b/adminer/include/design.inc.php index 48a2fcac..d54097d6 100644 --- a/adminer/include/design.inc.php +++ b/adminer/include/design.inc.php @@ -75,7 +75,7 @@ var thousandsSeparator = ''; ' . $drivers[DRIVER] . ' » '; + echo '