/** Connect to the database
* @param array{string, string, string} [$server, $username, $password]
- * @return mixed Db or string for error
+ * @return string|Db string for error
*/
function connect($credentials) {
global $drivers;
/** Get approximate number of rows
* @param TableStatus
* @param list<string>
- * @return numeric-string|void null if approximate number can't be retrieved
+ * @return numeric-string|null null if approximate number can't be retrieved
*/
function found_rows($table_status, $where) {
return ($where || $table_status["Engine"] != "InnoDB" ? null : $table_status["Rows"]);
}
- /* Not used is MySQL but checked in compile.php:
- /** Get user defined types
- * @return string[] [$id => $name]
- function types() {
- return array();
- }
-
- /** Get values of user defined type
- * @param int
- * @return string
- function type_values($id) {
- return "";
- }
-
- /** Get existing schemas
- * @return list<string>
- function schemas() {
- return array();
- }
-
- /** Get current schema
- * @return string
- function get_schema() {
- return "";
- }
-
- /** Set current schema
- * @param string
- * @param Db
- * @return bool
- function set_schema($schema, $connection2 = null) {
- return true;
- }
- */
-
/** Get SQL command to create table
* @param string
* @param bool
function max_connections() {
return get_val("SELECT @@max_connections");
}
+
+ // Not used is MySQL but checked in compile.php:
+
+ /** Get user defined types
+ * @return string[] [$id => $name]
+ */
+ function types() {
+ return array();
+ }
+
+ /** Get values of user defined type
+ * @param int
+ * @return string
+ */
+ function type_values($id) {
+ return "";
+ }
+
+ /** Get existing schemas
+ * @return list<string>
+ */
+ function schemas() {
+ return array();
+ }
+
+ /** Get current schema
+ * @return string
+ */
+ function get_schema() {
+ return "";
+ }
+
+ /** Set current schema
+ * @param string
+ * @param Db
+ * @return bool
+ */
+ function set_schema($schema, $connection2 = null) {
+ return true;
+ }
}
* @param string
* @param string
* @param string
-* @param string
+* @param ?string
* @return void
*/
function set_password($vendor, $server, $username, $password) {
}
/** Get password from session
-* @return string or null for missing password or false for expired password
+* @return string|false|null null for missing password, false for expired password
*/
function get_password() {
$return = get_session("pwds");
/** Execute and remember query
* @param string end with ';' to use DELIMITER
-* @return Result
+* @return Result|bool
*/
function queries($query) {
global $connection;
}
/** Format value to use in select
-* @param string
+* @param string|string[]
* @param string
* @param Field
* @param int
}
/** Check whether the string is e-mail address
-* @param string
+* @param ?string
* @return bool
*/
function is_mail($email) {
parameters:
- level: 3
+ level: 4
ignoreErrors:
# need to fix
- "~^Function Adminer\\\\fields_from_edit\\(\\) should return~" # Mongo and SimpleDB
- "~^Function Adminer\\\\explain\\(\\) should return Adminer\\\\Result~" # mysqli_result
-
+
# not real problems
- identifier: include.fileNotFound # relative includes
- identifier: includeOnce.fileNotFound # ./adminer-plugins.php
- "~^Function (foreign_keys_sql|recreate_table) not found~" # defined by other drivers
- "~^Variable \\$(adminer|connection|driver|drivers|error|HTTPS|LANG|langs|permanent|has_token|token|translations|VERSION) might not be defined~" # declared in bootstrap.inc.php
- "~^Method Adminer\\\\Plugins::\\w+\\(\\) with return type void~" # we use the same pattern for all methods
- - "~OCI-?Lob~" # maybe include stub?
+ - "~Call to function is_object\\(\\) with Adminer\\\\Db\\|string will always evaluate to false~" # is_object(Db) is true
+ - "~^Comparison operation \"==\" between \\(array\\|float\\|int\\) and 1~" # it thinks that $affected could be an array
# it probably doesn't like $ar[$key] instead of isset($ar[$key]) and thinks that $ar[$key] is always set
- - "~^Comparison operation \"==\" between \\(array\\|float\\|int\\) and 1~"
+ - identifier: identical.alwaysFalse
+ - identifier: notEqual.alwaysFalse
+ - identifier: notIdentical.alwaysTrue
+ - identifier: booleanNot.alwaysFalse
+ - identifier: booleanAnd.alwaysFalse
+ - identifier: booleanAnd.leftAlwaysTrue
+ - identifier: booleanAnd.rightAlwaysTrue
+ - identifier: booleanAnd.rightAlwaysFalse
+ - identifier: booleanOr.alwaysTrue
+ - identifier: booleanOr.leftAlwaysTrue
+ - identifier: ternary.alwaysTrue
+ - identifier: if.alwaysTrue
+ - identifier: while.alwaysTrue
+ - identifier: isset.offset
+ - identifier: deadCode.unreachable
paths:
- adminer/
- adminer/drivers/oracle.inc.php
- adminer/drivers/pgsql.inc.php
- adminer/drivers/sqlite.inc.php
-
+
phpVersion:
min: 70100
max: 80499
checkMissingCallableSignature: true
typeAliases:
- TableStatus: "array{Name:string, Engine?:?string, Comment?:string, Oid?:numeric-string, Rows?:numeric-string, Collation?:string, Auto_increment?:numeric-string, Data_length?:numeric-string, Index_length?:numeric-string, Data_free?:numeric-string, Create_options?:string, nspname?:string}"
- Field: "array{field:string, full_type:string, type:string, length:numeric-string, unsigned:string, default:?string, null:bool, auto_increment:bool, on_update:string, collation:string, privileges:int[], comment:string, primary:bool, generated:string, orig?:string, on_delete?:string, inout?:string}"
+ TableStatus: "array{Name:string, Engine?:?string, Comment?:string, Oid?:numeric-string, Rows?:?numeric-string, Collation?:string, Auto_increment?:?numeric-string, Data_length?:numeric-string, Index_length?:numeric-string, Data_free?:numeric-string, Create_options?:string, nspname?:string}"
+ Field: "array{field:?string, full_type:string, type:string, length:numeric-string, unsigned:string, default:?string, null:bool, auto_increment:bool, collation:string, privileges:int[], comment:string, primary:bool, generated:string, orig?:string, on_update:?string, on_delete?:string, inout?:string}"
Index: "array{type:string, columns:list<string>, lengths:list<numeric-string>, descs:list<?bool>}"
ForeignKey: "array{db:string, ns?:string, table:string, source:list<string>, target:list<string>, on_delete:string, on_update:string}"
Trigger: "array{Trigger?:string, Timing?:string, Event?:string, Of?:string, Type?:string, Statement?:string}"