Visitar URL original
Fix some issues and update SA baselines · phpmyadmin/phpmyadmin@4bd3a1c · GitHub
Skip to content

Commit 4bd3a1c

Browse files
committed
Fix some issues and update SA baselines
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
1 parent cb7d976 commit 4bd3a1c

8 files changed

Lines changed: 121 additions & 153 deletions

File tree

‎libraries/classes/Controllers/AbstractController.php‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
use function __;
1616
use function basename;
1717
use function defined;
18-
use function strlen;
1918

2019
abstract class AbstractController
2120
{

‎libraries/classes/Controllers/Table/TrackingController.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ public function __invoke(ServerRequest $request): void
243243
$versionParam,
244244
$GLOBALS['data'],
245245
isset($_POST['delete_ddlog']),
246-
isset($_POST['delete_dmlog']),
246+
isset($_POST['delete_dmlog'])
247247
);
248248
}
249249

‎libraries/classes/Controllers/View/CreateController.php‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
use function htmlspecialchars;
2626
use function in_array;
2727
use function is_array;
28-
use function is_null;
2928
use function is_string;
3029
use function sprintf;
3130
use function str_contains;
@@ -119,7 +118,7 @@ public function __invoke(ServerRequest $request): void
119118
*/
120119
$GLOBALS['sep'] = "\r\n";
121120

122-
if ($createView !== null) {
121+
if ($createview !== null) {
123122
$GLOBALS['sql_query'] = 'CREATE';
124123
if (isset($view['or_replace'])) {
125124
$GLOBALS['sql_query'] .= ' OR REPLACE';
@@ -168,7 +167,7 @@ public function __invoke(ServerRequest $request): void
168167
}
169168

170169
if (! $this->dbi->tryQuery($GLOBALS['sql_query'])) {
171-
if (is_null($ajaxdialog)) {
170+
if ($ajaxdialog === null) {
172171
$GLOBALS['message'] = Message::rawError($this->dbi->getError());
173172

174173
return;

‎libraries/classes/Tracking.php‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,11 +1049,10 @@ public function createTrackingForMultipleTables(string $db, array $selected, str
10491049
/**
10501050
* Function to get the entries
10511051
*
1052-
* @param array $data data
1053-
* @param int $filter_ts_from filter time stamp from
1054-
* @param int $filter_ts_to filter time stamp to
1055-
* @param array $filter_users filter users
1056-
* @param string $logtype
1052+
* @param array $data data
1053+
* @param int $filter_ts_from filter time stamp from
1054+
* @param int $filter_ts_to filter time stamp to
1055+
* @param array $filter_users filter users
10571056
* @phpstan-param 'schema'|'data'|'schema_and_data' $logtype
10581057
*
10591058
* @return array

‎libraries/classes/UserPassword.php‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ private function changePassHashingFunction(?string $authenticationPlugin): strin
124124
if ($authenticationPlugin === 'mysql_old_password') {
125125
return 'OLD_PASSWORD';
126126
}
127+
127128
return 'PASSWORD';
128129
}
129130

‎phpstan-baseline.neon‎

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1335,6 +1335,11 @@ parameters:
13351335
count: 1
13361336
path: libraries/classes/Controllers/Preferences/ManageController.php
13371337

1338+
-
1339+
message: "#^Parameter \\#1 \\$exportType of method PhpMyAdmin\\\\Export\\:\\:processExportSchema\\(\\) expects string\\|null, mixed given\\.$#"
1340+
count: 1
1341+
path: libraries/classes/Controllers/SchemaExportController.php
1342+
13381343
-
13391344
message: "#^Property PhpMyAdmin\\\\Controllers\\\\Server\\\\BinlogController\\:\\:\\$binaryLogs type has no value type specified in iterable type array\\.$#"
13401345
count: 1
@@ -1870,6 +1875,16 @@ parameters:
18701875
count: 1
18711876
path: libraries/classes/Controllers/TableController.php
18721877

1878+
-
1879+
message: "#^Call to function is_array\\(\\) with array will always evaluate to true\\.$#"
1880+
count: 1
1881+
path: libraries/classes/Controllers/View/CreateController.php
1882+
1883+
-
1884+
message: "#^PHPDoc tag @var for variable \\$view has no value type specified in iterable type array\\.$#"
1885+
count: 1
1886+
path: libraries/classes/Controllers/View/CreateController.php
1887+
18731888
-
18741889
message: "#^Parameter \\#1 \\$string of function substr expects string, mixed given\\.$#"
18751890
count: 1
@@ -3240,11 +3255,6 @@ parameters:
32403255
count: 1
32413256
path: libraries/classes/Display/Results.php
32423257

3243-
-
3244-
message: "#^Strict comparison using \\!\\=\\= between non\\-empty\\-string and false will always evaluate to true\\.$#"
3245-
count: 1
3246-
path: libraries/classes/Display/Results.php
3247-
32483258
-
32493259
message: "#^Foreach overwrites \\$engine with its value variable\\.$#"
32503260
count: 1
@@ -11360,6 +11370,11 @@ parameters:
1136011370
count: 1
1136111371
path: test/classes/TypesTest.php
1136211372

11373+
-
11374+
message: "#^Method PhpMyAdmin\\\\Tests\\\\UserPasswordTest\\:\\:providerSetChangePasswordMsg\\(\\) should return array\\<array\\{bool, PhpMyAdmin\\\\Message, string, string, string\\}\\> but returns array\\{array\\{false, PhpMyAdmin\\\\Message, true, '', ''\\}, array\\{true, PhpMyAdmin\\\\Message, false, '', ''\\}, array\\{true, PhpMyAdmin\\\\Message, false, 'a', ''\\}, array\\{true, PhpMyAdmin\\\\Message, false, '', 'a'\\}, array\\{true, PhpMyAdmin\\\\Message, false, 'a', 'b'\\}, array\\{true, PhpMyAdmin\\\\Message, false, literal\\-string&non\\-falsy\\-string, literal\\-string&non\\-falsy\\-string\\}, array\\{false, PhpMyAdmin\\\\Message, false, literal\\-string&non\\-falsy\\-string, literal\\-string&non\\-falsy\\-string\\}\\}\\.$#"
11375+
count: 1
11376+
path: test/classes/UserPasswordTest.php
11377+
1136311378
-
1136411379
message: "#^Casting to string something that's already string\\.$#"
1136511380
count: 1

0 commit comments

Comments
 (0)