mirror of
https://github.com/vrana/adminer.git
synced 2025-08-06 06:37:33 +02:00
PHPStan: Fix level 6 errors
This commit is contained in:
@@ -91,9 +91,14 @@ if ($in) {
|
|||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
<?php
|
<?php
|
||||||
|
/** Format string as table row
|
||||||
|
* @param string
|
||||||
|
* @return string HTML
|
||||||
|
*/
|
||||||
function pre_tr($s) {
|
function pre_tr($s) {
|
||||||
return preg_replace('~^~m', '<tr>', preg_replace('~\|~', '<td>', preg_replace('~\|$~m', "", rtrim($s))));
|
return preg_replace('~^~m', '<tr>', preg_replace('~\|~', '<td>', preg_replace('~\|$~m', "", rtrim($s))));
|
||||||
}
|
}
|
||||||
|
|
||||||
$table = '(\+--[-+]+\+\n)';
|
$table = '(\+--[-+]+\+\n)';
|
||||||
$row = '(\| .* \|\n)';
|
$row = '(\| .* \|\n)';
|
||||||
echo preg_replace_callback(
|
echo preg_replace_callback(
|
||||||
|
@@ -61,16 +61,16 @@ if (!defined('Adminer\DRIVER')) {
|
|||||||
|
|
||||||
} elseif (extension_loaded("mysql") && !((ini_bool("sql.safe_mode") || ini_bool("mysql.allow_local_infile")) && extension_loaded("pdo_mysql"))) {
|
} elseif (extension_loaded("mysql") && !((ini_bool("sql.safe_mode") || ini_bool("mysql.allow_local_infile")) && extension_loaded("pdo_mysql"))) {
|
||||||
class Db {
|
class Db {
|
||||||
public
|
/** @var string */ public $extension = "MySQL"; // extension name
|
||||||
$extension = "MySQL", ///< @var string extension name
|
/** @var string */ public $flavor = ''; // different vendor with the same API; e.g. MariaDB; usually stays empty
|
||||||
$flavor = '', ///< @var string different vendor with the same API, e.g. MariaDB, usually stays empty
|
/** @var string */ public $server_info; // server version
|
||||||
$server_info, ///< @var string server version
|
/** @var int */ public $affected_rows; // number of affected rows
|
||||||
$affected_rows, ///< @var int number of affected rows
|
/** @var string */ public $info; // see https://php.net/mysql_info
|
||||||
$info, ///< @var string see https://php.net/mysql_info
|
/** @var int */ public $errno; // last error code
|
||||||
$errno, ///< @var int last error code
|
/** @var string */ public $error; // last error message
|
||||||
$error ///< @var string last error message
|
|
||||||
;
|
/** @var \mysqli */ private $link;
|
||||||
private $link, $result;
|
/** @var Result */ private $result;
|
||||||
|
|
||||||
/** Connect to server
|
/** Connect to server
|
||||||
* @param string
|
* @param string
|
||||||
@@ -132,7 +132,7 @@ if (!defined('Adminer\DRIVER')) {
|
|||||||
/** Send query
|
/** Send query
|
||||||
* @param string
|
* @param string
|
||||||
* @param bool
|
* @param bool
|
||||||
* @return mixed bool or Result
|
* @return Result|bool
|
||||||
*/
|
*/
|
||||||
function query($query, $unbuffered = false) {
|
function query($query, $unbuffered = false) {
|
||||||
$result = @($unbuffered ? mysql_unbuffered_query($query, $this->link) : mysql_query($query, $this->link)); // @ - mute mysql.trace_mode
|
$result = @($unbuffered ? mysql_unbuffered_query($query, $this->link) : mysql_query($query, $this->link)); // @ - mute mysql.trace_mode
|
||||||
@@ -152,7 +152,7 @@ if (!defined('Adminer\DRIVER')) {
|
|||||||
|
|
||||||
/** Send query with more resultsets
|
/** Send query with more resultsets
|
||||||
* @param string
|
* @param string
|
||||||
* @return bool
|
* @return Result|bool
|
||||||
*/
|
*/
|
||||||
function multi_query($query) {
|
function multi_query($query) {
|
||||||
return $this->result = $this->query($query);
|
return $this->result = $this->query($query);
|
||||||
@@ -185,8 +185,9 @@ if (!defined('Adminer\DRIVER')) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class Result {
|
class Result {
|
||||||
public $num_rows; ///< @var int number of rows in the result
|
/** @var int */ public $num_rows; // number of rows in the result
|
||||||
private $result, $offset = 0;
|
/** @var resource */ private $result;
|
||||||
|
/** @var int */ private $offset = 0;
|
||||||
|
|
||||||
/** Constructor
|
/** Constructor
|
||||||
* @param resource
|
* @param resource
|
||||||
@@ -286,13 +287,13 @@ if (!defined('Adminer\DRIVER')) {
|
|||||||
|
|
||||||
|
|
||||||
class Driver extends SqlDriver {
|
class Driver extends SqlDriver {
|
||||||
static $possibleDrivers = array("MySQLi", "MySQL", "PDO_MySQL");
|
/** @var list<string> */ static $possibleDrivers = array("MySQLi", "MySQL", "PDO_MySQL");
|
||||||
static $jush = "sql"; ///< @var string JUSH identifier
|
/** @var string */ static $jush = "sql"; // JUSH identifier
|
||||||
|
|
||||||
public $unsigned = array("unsigned", "zerofill", "unsigned zerofill");
|
/** @var list<string> */ public $unsigned = array("unsigned", "zerofill", "unsigned zerofill");
|
||||||
public $operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "REGEXP", "IN", "FIND_IN_SET", "IS NULL", "NOT LIKE", "NOT REGEXP", "NOT IN", "IS NOT NULL", "SQL");
|
/** @var list<string> */ public $operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "REGEXP", "IN", "FIND_IN_SET", "IS NULL", "NOT LIKE", "NOT REGEXP", "NOT IN", "IS NOT NULL", "SQL");
|
||||||
public $functions = array("char_length", "date", "from_unixtime", "lower", "round", "floor", "ceil", "sec_to_time", "time_to_sec", "upper");
|
/** @var list<string> */ public $functions = array("char_length", "date", "from_unixtime", "lower", "round", "floor", "ceil", "sec_to_time", "time_to_sec", "upper");
|
||||||
public $grouping = array("avg", "count", "count distinct", "group_concat", "max", "min", "sum");
|
/** @var list<string> */ public $grouping = array("avg", "count", "count distinct", "group_concat", "max", "min", "sum");
|
||||||
|
|
||||||
function __construct($connection) {
|
function __construct($connection) {
|
||||||
parent::__construct($connection);
|
parent::__construct($connection);
|
||||||
|
@@ -4,8 +4,8 @@ namespace Adminer;
|
|||||||
// any method change in this file should be transferred to editor/include/adminer.inc.php and plugins.inc.php
|
// any method change in this file should be transferred to editor/include/adminer.inc.php and plugins.inc.php
|
||||||
|
|
||||||
class Adminer {
|
class Adminer {
|
||||||
public $operators; ///< @var list<string> operators used in select, null for all operators
|
/** @var list<string> */ public $operators; // operators used in select, null for all operators
|
||||||
public $error = ''; ///< @var string @visibility protected(set) string HTML
|
/** @var string @visibility protected(set) */ public $error = ''; // HTML
|
||||||
|
|
||||||
/** Name in title and navigation
|
/** Name in title and navigation
|
||||||
* @return string HTML code
|
* @return string HTML code
|
||||||
@@ -264,6 +264,7 @@ class Adminer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Print HTML code just before the Execute button in SQL command
|
/** Print HTML code just before the Execute button in SQL command
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
function sqlPrintAfter() {
|
function sqlPrintAfter() {
|
||||||
}
|
}
|
||||||
@@ -689,7 +690,7 @@ class Adminer {
|
|||||||
|
|
||||||
/** Print before edit form
|
/** Print before edit form
|
||||||
* @param string
|
* @param string
|
||||||
* @param array[]
|
* @param Field[]
|
||||||
* @param mixed
|
* @param mixed
|
||||||
* @param bool
|
* @param bool
|
||||||
* @return void
|
* @return void
|
||||||
@@ -1052,6 +1053,7 @@ class Adminer {
|
|||||||
|
|
||||||
/** Set up syntax highlight for code and <textarea>
|
/** Set up syntax highlight for code and <textarea>
|
||||||
* @param TableStatus[] result of table_status('', true)
|
* @param TableStatus[] result of table_status('', true)
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
function syntaxHighlighting($tables) {
|
function syntaxHighlighting($tables) {
|
||||||
global $connection;
|
global $connection;
|
||||||
|
@@ -17,6 +17,7 @@ if ($_COOKIE["adminer_permanent"]) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @return void */
|
||||||
function add_invalid_login() {
|
function add_invalid_login() {
|
||||||
global $adminer;
|
global $adminer;
|
||||||
$base = get_temp_dir() . "/adminer.invalid";
|
$base = get_temp_dir() . "/adminer.invalid";
|
||||||
@@ -50,6 +51,7 @@ function add_invalid_login() {
|
|||||||
file_write_unlock($fp, serialize($invalids));
|
file_write_unlock($fp, serialize($invalids));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @return void */
|
||||||
function check_invalid_login() {
|
function check_invalid_login() {
|
||||||
global $adminer;
|
global $adminer;
|
||||||
$invalids = array();
|
$invalids = array();
|
||||||
@@ -113,6 +115,7 @@ if ($auth) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @return void */
|
||||||
function unset_permanent() {
|
function unset_permanent() {
|
||||||
global $permanent;
|
global $permanent;
|
||||||
foreach ($permanent as $key => $val) {
|
foreach ($permanent as $key => $val) {
|
||||||
|
@@ -3,6 +3,7 @@ namespace Adminer;
|
|||||||
|
|
||||||
// coverage is used in tests and removed in compilation
|
// coverage is used in tests and removed in compilation
|
||||||
if (extension_loaded("xdebug") && file_exists(sys_get_temp_dir() . "/adminer.coverage")) {
|
if (extension_loaded("xdebug") && file_exists(sys_get_temp_dir() . "/adminer.coverage")) {
|
||||||
|
/** @return void */
|
||||||
function save_coverage() {
|
function save_coverage() {
|
||||||
$coverage_filename = sys_get_temp_dir() . "/adminer.coverage";
|
$coverage_filename = sys_get_temp_dir() . "/adminer.coverage";
|
||||||
$coverage = unserialize(file_get_contents($coverage_filename));
|
$coverage = unserialize(file_get_contents($coverage_filename));
|
||||||
|
@@ -23,20 +23,20 @@ function get_driver($id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
abstract class SqlDriver {
|
abstract class SqlDriver {
|
||||||
static $possibleDrivers = array(); ///< @var list<string>
|
/** @var list<string> */ static $possibleDrivers = array();
|
||||||
static $jush; ///< @var string JUSH identifier
|
/** @var string */ static $jush; // JUSH identifier
|
||||||
|
|
||||||
protected $conn; ///< @var Db
|
/** @var Db */ protected $conn;
|
||||||
protected $types = array(); ///< @var int[][] [$group => [$type => $maximum_unsigned_length, ...], ...]
|
/** @var int[][] */ protected $types = array(); // [$group => [$type => $maximum_unsigned_length, ...], ...]
|
||||||
public $editFunctions = array(); ///< @var array of ["$type|$type2" => "$function/$function2"] functions used in editing, [0] - edit and insert, [1] - edit only
|
/** @var array{0?:string[], 1?:string[]} */ public $editFunctions = array(); // of ["$type|$type2" => "$function/$function2"] functions used in editing, [0] - edit and insert, [1] - edit only
|
||||||
public $unsigned = array(); ///< @var list<string> number variants
|
/** @var list<string> */ public $unsigned = array(); // number variants
|
||||||
public $operators = array(); ///< @var list<string> operators used in select
|
/** @var list<string> */ public $operators = array(); // operators used in select
|
||||||
public $functions = array(); ///< @var list<string> functions used in select
|
/** @var list<string> */ public $functions = array(); // functions used in select
|
||||||
public $grouping = array(); ///< @var list<string> grouping functions used in select
|
/** @var list<string> */ public $grouping = array(); // grouping functions used in select
|
||||||
public $onActions = "RESTRICT|NO ACTION|CASCADE|SET NULL|SET DEFAULT"; ///< @var string used in foreign_keys()
|
/** @var string */ public $onActions = "RESTRICT|NO ACTION|CASCADE|SET NULL|SET DEFAULT"; // used in foreign_keys()
|
||||||
public $inout = "IN|OUT|INOUT"; ///< @var string used in routines
|
/** @var string */ public $inout = "IN|OUT|INOUT"; // used in routines
|
||||||
public $enumLength = "'(?:''|[^'\\\\]|\\\\.)*'"; ///< @var string regular expression for parsing enum lengths
|
/** @var string */ public $enumLength = "'(?:''|[^'\\\\]|\\\\.)*'"; // regular expression for parsing enum lengths
|
||||||
public $generated = array(); ///< @var list<string> allowed types of generated columns
|
/** @var list<string> */ public $generated = array(); // allowed types of generated columns
|
||||||
|
|
||||||
/** Create object for performing database operations
|
/** Create object for performing database operations
|
||||||
* @param Db
|
* @param Db
|
||||||
|
@@ -67,7 +67,7 @@ function escape_string($val) {
|
|||||||
|
|
||||||
/** Get a possibly missing item from a possibly missing array
|
/** Get a possibly missing item from a possibly missing array
|
||||||
* idx($row, $key) is better than $row[$key] ?? null because PHP will report error for undefined $row
|
* idx($row, $key) is better than $row[$key] ?? null because PHP will report error for undefined $row
|
||||||
* @param ?array
|
* @param ?mixed[]
|
||||||
* @param string|int
|
* @param string|int
|
||||||
* @param mixed
|
* @param mixed
|
||||||
* @return mixed
|
* @return mixed
|
||||||
@@ -543,8 +543,8 @@ function query_redirect($query, $location, $message, $redirect = true, $execute
|
|||||||
}
|
}
|
||||||
|
|
||||||
class Queries {
|
class Queries {
|
||||||
static $queries = array();
|
/** @var string[] */ static $queries = array();
|
||||||
static $start;
|
/** @var float */ static $start;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Execute and remember query
|
/** Execute and remember query
|
||||||
@@ -846,6 +846,7 @@ function file_open_lock($filename) {
|
|||||||
/** Write and unlock a file
|
/** Write and unlock a file
|
||||||
* @param resource
|
* @param resource
|
||||||
* @param string
|
* @param string
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
function file_write_unlock($fp, $data) {
|
function file_write_unlock($fp, $data) {
|
||||||
rewind($fp);
|
rewind($fp);
|
||||||
@@ -856,6 +857,7 @@ function file_write_unlock($fp, $data) {
|
|||||||
|
|
||||||
/** Unlock and close a file
|
/** Unlock and close a file
|
||||||
* @param resource
|
* @param resource
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
function file_unlock($fp) {
|
function file_unlock($fp) {
|
||||||
flock($fp, LOCK_UN);
|
flock($fp, LOCK_UN);
|
||||||
@@ -863,8 +865,8 @@ function file_unlock($fp) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Get first element of an array
|
/** Get first element of an array
|
||||||
* @param array
|
* @param mixed[]
|
||||||
* @return mixed or false if not found
|
* @return mixed if not found
|
||||||
*/
|
*/
|
||||||
function first($array) {
|
function first($array) {
|
||||||
// reset(f()) triggers a notice
|
// reset(f()) triggers a notice
|
||||||
@@ -1029,6 +1031,10 @@ function verify_token() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// used in compiled version
|
// used in compiled version
|
||||||
|
/**
|
||||||
|
* @param string
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
function lzw_decompress($binary) {
|
function lzw_decompress($binary) {
|
||||||
// convert binary string to codes
|
// convert binary string to codes
|
||||||
$dictionary_count = 256;
|
$dictionary_count = 256;
|
||||||
|
@@ -197,7 +197,7 @@ function pagination($page, $current) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Print hidden fields
|
/** Print hidden fields
|
||||||
* @param array
|
* @param mixed[]
|
||||||
* @param list<string>
|
* @param list<string>
|
||||||
* @param string
|
* @param string
|
||||||
* @return bool
|
* @return bool
|
||||||
|
@@ -92,6 +92,7 @@ function lang($idf, $number = null) {
|
|||||||
return vsprintf($format, $args);
|
return vsprintf($format, $args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @return void */
|
||||||
function switch_lang() {
|
function switch_lang() {
|
||||||
global $LANG, $langs;
|
global $LANG, $langs;
|
||||||
echo "<form action='' method='post'>\n<div id='lang'>";
|
echo "<form action='' method='post'>\n<div id='lang'>";
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
namespace Adminer;
|
namespace Adminer;
|
||||||
|
|
||||||
class Plugins extends Adminer {
|
class Plugins extends Adminer {
|
||||||
public $plugins; ///< @var list<object> @visibility protected(set)
|
/** @var list<object> @visibility protected(set) */ public $plugins;
|
||||||
|
|
||||||
/** Register plugins
|
/** Register plugins
|
||||||
* @param ?list<object> object instances or null to autoload plugins from adminer-plugins/
|
* @param ?list<object> object instances or null to autoload plugins from adminer-plugins/
|
||||||
@@ -42,10 +42,20 @@ class Plugins extends Adminer {
|
|||||||
$this->plugins = $plugins;
|
$this->plugins = $plugins;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param literal-string
|
||||||
|
* @param mixed[]
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
private function callParent($function, $args) {
|
private function callParent($function, $args) {
|
||||||
return call_user_func_array(array('parent', $function), $args);
|
return call_user_func_array(array('parent', $function), $args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param literal-string
|
||||||
|
* @param mixed[]
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
private function applyPlugin($function, $params) {
|
private function applyPlugin($function, $params) {
|
||||||
$args = array();
|
$args = array();
|
||||||
foreach ($params as $key => $val) {
|
foreach ($params as $key => $val) {
|
||||||
@@ -63,6 +73,11 @@ class Plugins extends Adminer {
|
|||||||
return $this->callParent($function, $args);
|
return $this->callParent($function, $args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param literal-string
|
||||||
|
* @param mixed[]
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
private function appendPlugin($function, $args) {
|
private function appendPlugin($function, $args) {
|
||||||
$return = $this->callParent($function, $args);
|
$return = $this->callParent($function, $args);
|
||||||
foreach ($this->plugins as $plugin) {
|
foreach ($this->plugins as $plugin) {
|
||||||
|
@@ -2,18 +2,23 @@
|
|||||||
namespace Adminer;
|
namespace Adminer;
|
||||||
|
|
||||||
class TmpFile {
|
class TmpFile {
|
||||||
private $handler;
|
/** @var resource */ private $handler;
|
||||||
public $size; ///< @visibility protected(set)
|
/** @var int @visibility protected(set) */ public $size;
|
||||||
|
|
||||||
function __construct() {
|
function __construct() {
|
||||||
$this->handler = tmpfile();
|
$this->handler = tmpfile();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
function write($contents) {
|
function write($contents) {
|
||||||
$this->size += strlen($contents);
|
$this->size += strlen($contents);
|
||||||
fwrite($this->handler, $contents);
|
fwrite($this->handler, $contents);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @return void */
|
||||||
function send() {
|
function send() {
|
||||||
fseek($this->handler, 0);
|
fseek($this->handler, 0);
|
||||||
fpassthru($this->handler);
|
fpassthru($this->handler);
|
||||||
|
@@ -6,6 +6,10 @@ namespace Adminer;
|
|||||||
* @link http://www.coolcode.cn/?action=show&id=128
|
* @link http://www.coolcode.cn/?action=show&id=128
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param int
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
function int32($n) {
|
function int32($n) {
|
||||||
while ($n >= 2147483648) {
|
while ($n >= 2147483648) {
|
||||||
$n -= 4294967296;
|
$n -= 4294967296;
|
||||||
@@ -16,6 +20,11 @@ function int32($n) {
|
|||||||
return (int) $n;
|
return (int) $n;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param int[]
|
||||||
|
* @param bool
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
function long2str($v, $w) {
|
function long2str($v, $w) {
|
||||||
$s = '';
|
$s = '';
|
||||||
foreach ($v as $val) {
|
foreach ($v as $val) {
|
||||||
@@ -27,6 +36,11 @@ function long2str($v, $w) {
|
|||||||
return $s;
|
return $s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string
|
||||||
|
* @param bool
|
||||||
|
* @return int[]
|
||||||
|
*/
|
||||||
function str2long($s, $w) {
|
function str2long($s, $w) {
|
||||||
$v = array_values(unpack('V*', str_pad($s, 4 * ceil(strlen($s) / 4), "\0")));
|
$v = array_values(unpack('V*', str_pad($s, 4 * ceil(strlen($s) / 4), "\0")));
|
||||||
if ($w) {
|
if ($w) {
|
||||||
@@ -35,6 +49,13 @@ function str2long($s, $w) {
|
|||||||
return $v;
|
return $v;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param int
|
||||||
|
* @param int
|
||||||
|
* @param int
|
||||||
|
* @param int
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
function xxtea_mx($z, $y, $sum, $k) {
|
function xxtea_mx($z, $y, $sum, $k) {
|
||||||
return int32((($z >> 5 & 0x7FFFFFF) ^ $y << 2) + (($y >> 3 & 0x1FFFFFFF) ^ $z << 4)) ^ int32(($sum ^ $y) + ($k ^ $z));
|
return int32((($z >> 5 & 0x7FFFFFF) ^ $y << 2) + (($y >> 3 & 0x1FFFFFFF) ^ $z << 4)) ^ int32(($sum ^ $y) + ($k ^ $z));
|
||||||
}
|
}
|
||||||
|
@@ -219,7 +219,7 @@ function minify_js($file) {
|
|||||||
return lzw_compress($file);
|
return lzw_compress($file);
|
||||||
}
|
}
|
||||||
|
|
||||||
function compile_file($match, $callback = '') { // $callback only to match signature
|
function compile_file($match, $callback) { // $callback only to match signature
|
||||||
global $project;
|
global $project;
|
||||||
$file = "";
|
$file = "";
|
||||||
list(, $filenames, $callback) = $match;
|
list(, $filenames, $callback) = $match;
|
||||||
|
13
phpstan.neon
13
phpstan.neon
@@ -1,9 +1,10 @@
|
|||||||
parameters:
|
parameters:
|
||||||
level: 5
|
level: 6
|
||||||
|
|
||||||
ignoreErrors:
|
ignoreErrors:
|
||||||
# need to fix
|
# need to fix
|
||||||
- "~^Function Adminer\\\\fields_from_edit\\(\\) should return~" # Mongo and SimpleDB
|
- "~^Function Adminer\\\\fields_from_edit\\(\\) should return~" # Mongo and SimpleDB
|
||||||
- "~^Function Adminer\\\\explain\\(\\) should return Adminer\\\\Result~" # mysqli_result
|
- "~Adminer\\\\Result.*mysqli_result~" # mysqli_result
|
||||||
- "~expects array~" # different shape of array
|
- "~expects array~" # different shape of array
|
||||||
|
|
||||||
# not real problems
|
# not real problems
|
||||||
@@ -20,6 +21,7 @@ parameters:
|
|||||||
- "~expects bool~" # truthy values
|
- "~expects bool~" # truthy values
|
||||||
- "~fread expects int<1, max>, 100000~" # 1e6
|
- "~fread expects int<1, max>, 100000~" # 1e6
|
||||||
- "~'strlen' given~" # used as a bool callback
|
- "~'strlen' given~" # used as a bool callback
|
||||||
|
- "~Adminer\\\\(Db|PdoDb).* type specified~" # duplicate methods
|
||||||
|
|
||||||
# it probably doesn't like $ar[$key] instead of isset($ar[$key]) and thinks that $ar[$key] is always set
|
# it probably doesn't like $ar[$key] instead of isset($ar[$key]) and thinks that $ar[$key] is always set
|
||||||
- identifier: identical.alwaysFalse
|
- identifier: identical.alwaysFalse
|
||||||
@@ -37,9 +39,10 @@ parameters:
|
|||||||
- identifier: while.alwaysTrue
|
- identifier: while.alwaysTrue
|
||||||
- identifier: isset.offset
|
- identifier: isset.offset
|
||||||
- identifier: deadCode.unreachable
|
- identifier: deadCode.unreachable
|
||||||
|
|
||||||
paths:
|
paths:
|
||||||
- adminer/
|
- adminer/
|
||||||
|
scanFiles:
|
||||||
- compile.php # compile_file()
|
- compile.php # compile_file()
|
||||||
excludePaths:
|
excludePaths:
|
||||||
- adminer/designs.php
|
- adminer/designs.php
|
||||||
@@ -53,7 +56,7 @@ parameters:
|
|||||||
phpVersion:
|
phpVersion:
|
||||||
min: 70100
|
min: 70100
|
||||||
max: 80499
|
max: 80499
|
||||||
checkMissingCallableSignature: true
|
|
||||||
typeAliases:
|
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}"
|
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}"
|
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}"
|
||||||
@@ -61,5 +64,5 @@ parameters:
|
|||||||
ForeignKey: "array{db:string, ns?:string, table:string, source:list<string>, target:list<string>, on_delete:string, on_update:string}"
|
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}"
|
Trigger: "array{Trigger?:string, Timing?:string, Event?:string, Of?:string, Type?:string, Statement?:string}"
|
||||||
RoutineField: "array{field:string, type:string, length:?string, unsigned:string, null:bool, full_type:string, inout:string, collation:string}"
|
RoutineField: "array{field:string, type:string, length:?string, unsigned:string, null:bool, full_type:string, inout:string, collation:string}"
|
||||||
Routine: "array{name?:string, fields:list<RoutineField>, comment:string, returns?:array, definition:string, language?:string}"
|
Routine: "array{name?:string, fields:list<RoutineField>, comment:string, returns?:array{type:string, length:string, unsigned:string, collation:string}, definition:string, language?:string}"
|
||||||
BackwardKey: "array{name:string, keys:string[][]}"
|
BackwardKey: "array{name:string, keys:string[][]}"
|
||||||
|
Reference in New Issue
Block a user