Skip to content

Commit 5f7ab15

Browse files
committed
Update Psalm and PHPStan baselines
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
1 parent 66f0c28 commit 5f7ab15

4 files changed

Lines changed: 127 additions & 60 deletions

File tree

libraries/classes/Controllers/NavigationController.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ public function __invoke(ServerRequest $request): void
6666

6767
$relationParameters = $this->relation->getRelationParameters();
6868
if ($relationParameters->navigationItemsHidingFeature !== null) {
69-
7069
$itemName = $request->getParsedBodyParam('itemName', '');
7170
$itemType = $request->getParsedBodyParam('itemType', '');
7271
$dbName = $request->getParsedBodyParam('dbName', '');

phpstan-baseline.neon

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1355,6 +1355,51 @@ parameters:
13551355
count: 1
13561356
path: libraries/classes/Controllers/HomeController.php
13571357

1358+
-
1359+
message: "#^Parameter \\#1 \\$database of method PhpMyAdmin\\\\Navigation\\\\Navigation\\:\\:getItemUnhideDialog\\(\\) expects string, mixed given\\.$#"
1360+
count: 1
1361+
path: libraries/classes/Controllers/NavigationController.php
1362+
1363+
-
1364+
message: "#^Parameter \\#1 \\$itemName of method PhpMyAdmin\\\\Navigation\\\\Navigation\\:\\:hideNavigationItem\\(\\) expects string, mixed given\\.$#"
1365+
count: 1
1366+
path: libraries/classes/Controllers/NavigationController.php
1367+
1368+
-
1369+
message: "#^Parameter \\#1 \\$itemName of method PhpMyAdmin\\\\Navigation\\\\Navigation\\:\\:unhideNavigationItem\\(\\) expects string, mixed given\\.$#"
1370+
count: 1
1371+
path: libraries/classes/Controllers/NavigationController.php
1372+
1373+
-
1374+
message: "#^Parameter \\#2 \\$itemType of method PhpMyAdmin\\\\Navigation\\\\Navigation\\:\\:hideNavigationItem\\(\\) expects string, mixed given\\.$#"
1375+
count: 1
1376+
path: libraries/classes/Controllers/NavigationController.php
1377+
1378+
-
1379+
message: "#^Parameter \\#2 \\$itemType of method PhpMyAdmin\\\\Navigation\\\\Navigation\\:\\:unhideNavigationItem\\(\\) expects string, mixed given\\.$#"
1380+
count: 1
1381+
path: libraries/classes/Controllers/NavigationController.php
1382+
1383+
-
1384+
message: "#^Parameter \\#3 \\$dbName of method PhpMyAdmin\\\\Navigation\\\\Navigation\\:\\:hideNavigationItem\\(\\) expects string, mixed given\\.$#"
1385+
count: 1
1386+
path: libraries/classes/Controllers/NavigationController.php
1387+
1388+
-
1389+
message: "#^Parameter \\#3 \\$dbName of method PhpMyAdmin\\\\Navigation\\\\Navigation\\:\\:unhideNavigationItem\\(\\) expects string, mixed given\\.$#"
1390+
count: 1
1391+
path: libraries/classes/Controllers/NavigationController.php
1392+
1393+
-
1394+
message: "#^Parameter \\#4 \\$tableName of method PhpMyAdmin\\\\Navigation\\\\Navigation\\:\\:hideNavigationItem\\(\\) expects string\\|null, mixed given\\.$#"
1395+
count: 1
1396+
path: libraries/classes/Controllers/NavigationController.php
1397+
1398+
-
1399+
message: "#^Parameter \\#4 \\$tableName of method PhpMyAdmin\\\\Navigation\\\\Navigation\\:\\:unhideNavigationItem\\(\\) expects string\\|null, mixed given\\.$#"
1400+
count: 1
1401+
path: libraries/classes/Controllers/NavigationController.php
1402+
13581403
-
13591404
message: "#^Parameter \\#3 \\$normalizedTo of method PhpMyAdmin\\\\Normalization\\:\\:getHtmlFor1NFStep1\\(\\) expects string, mixed given\\.$#"
13601405
count: 1
@@ -1515,6 +1560,41 @@ parameters:
15151560
count: 1
15161561
path: libraries/classes/Controllers/Server/ReplicationController.php
15171562

1563+
-
1564+
message: "#^Parameter \\#1 \\$requiredData of method PhpMyAdmin\\\\Server\\\\Status\\\\Monitor\\:\\:getJsonForChartingData\\(\\) expects string, mixed given\\.$#"
1565+
count: 1
1566+
path: libraries/classes/Controllers/Server/Status/Monitor/ChartingDataController.php
1567+
1568+
-
1569+
message: "#^Cannot cast mixed to int\\.$#"
1570+
count: 2
1571+
path: libraries/classes/Controllers/Server/Status/Monitor/GeneralLogController.php
1572+
1573+
-
1574+
message: "#^Parameter \\#1 \\$name of method PhpMyAdmin\\\\Server\\\\Status\\\\Monitor\\:\\:getJsonForLoggingVars\\(\\) expects string\\|null, mixed given\\.$#"
1575+
count: 1
1576+
path: libraries/classes/Controllers/Server/Status/Monitor/LogVarsController.php
1577+
1578+
-
1579+
message: "#^Parameter \\#2 \\$value of method PhpMyAdmin\\\\Server\\\\Status\\\\Monitor\\:\\:getJsonForLoggingVars\\(\\) expects string\\|null, mixed given\\.$#"
1580+
count: 1
1581+
path: libraries/classes/Controllers/Server/Status/Monitor/LogVarsController.php
1582+
1583+
-
1584+
message: "#^Parameter \\#1 \\$database of method PhpMyAdmin\\\\Server\\\\Status\\\\Monitor\\:\\:getJsonForQueryAnalyzer\\(\\) expects string, mixed given\\.$#"
1585+
count: 1
1586+
path: libraries/classes/Controllers/Server/Status/Monitor/QueryAnalyzerController.php
1587+
1588+
-
1589+
message: "#^Parameter \\#2 \\$query of method PhpMyAdmin\\\\Server\\\\Status\\\\Monitor\\:\\:getJsonForQueryAnalyzer\\(\\) expects string, mixed given\\.$#"
1590+
count: 1
1591+
path: libraries/classes/Controllers/Server/Status/Monitor/QueryAnalyzerController.php
1592+
1593+
-
1594+
message: "#^Cannot cast mixed to int\\.$#"
1595+
count: 2
1596+
path: libraries/classes/Controllers/Server/Status/Monitor/SlowLogController.php
1597+
15181598
-
15191599
message: "#^Method PhpMyAdmin\\\\Controllers\\\\Server\\\\Status\\\\Processes\\\\KillController\\:\\:__invoke\\(\\) has parameter \\$params with no value type specified in iterable type array\\.$#"
15201600
count: 1
@@ -1540,6 +1620,11 @@ parameters:
15401620
count: 1
15411621
path: libraries/classes/Controllers/Server/Status/StatusController.php
15421622

1623+
-
1624+
message: "#^Parameter \\#1 \\$connection of method PhpMyAdmin\\\\ReplicationGui\\:\\:getHtmlForReplicationStatusTable\\(\\) expects string\\|null, mixed given\\.$#"
1625+
count: 2
1626+
path: libraries/classes/Controllers/Server/Status/StatusController.php
1627+
15431628
-
15441629
message: "#^Method PhpMyAdmin\\\\Controllers\\\\Server\\\\Status\\\\VariablesController\\:\\:getAlerts\\(\\) return type has no value type specified in iterable type array\\.$#"
15451630
count: 1
@@ -1550,6 +1635,11 @@ parameters:
15501635
count: 1
15511636
path: libraries/classes/Controllers/Server/Status/VariablesController.php
15521637

1638+
-
1639+
message: "#^Parameter \\#1 \\$flush of method PhpMyAdmin\\\\Controllers\\\\Server\\\\Status\\\\VariablesController\\:\\:flush\\(\\) expects string, mixed given\\.$#"
1640+
count: 1
1641+
path: libraries/classes/Controllers/Server/Status/VariablesController.php
1642+
15531643
-
15541644
message: "#^Method PhpMyAdmin\\\\Controllers\\\\Server\\\\Variables\\\\GetVariableController\\:\\:__invoke\\(\\) has parameter \\$params with no value type specified in iterable type array\\.$#"
15551645
count: 1

psalm-baseline.xml

Lines changed: 37 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -2310,26 +2310,24 @@
23102310
</MixedAssignment>
23112311
</file>
23122312
<file src="libraries/classes/Controllers/NavigationController.php">
2313-
<PossiblyInvalidArgument occurrences="9">
2314-
<code>! empty($_POST['tableName']) ? $_POST['tableName'] : null</code>
2315-
<code>! empty($_POST['tableName']) ? $_POST['tableName'] : null</code>
2316-
<code>$_POST['dbName']</code>
2317-
<code>$_POST['dbName']</code>
2318-
<code>$_POST['dbName']</code>
2319-
<code>$_POST['itemName']</code>
2320-
<code>$_POST['itemName']</code>
2321-
<code>$_POST['itemType']</code>
2322-
<code>$_POST['itemType']</code>
2323-
</PossiblyInvalidArgument>
2324-
<PossiblyInvalidCast occurrences="7">
2325-
<code>$_POST['dbName']</code>
2326-
<code>$_POST['dbName']</code>
2327-
<code>$_POST['dbName']</code>
2328-
<code>$_POST['itemName']</code>
2329-
<code>$_POST['itemName']</code>
2330-
<code>$_POST['itemType']</code>
2331-
<code>$_POST['itemType']</code>
2332-
</PossiblyInvalidCast>
2313+
<MixedArgument occurrences="9">
2314+
<code>! empty($tableName) ? $tableName : null</code>
2315+
<code>! empty($tableName) ? $tableName : null</code>
2316+
<code>$dbName</code>
2317+
<code>$dbName</code>
2318+
<code>$dbName</code>
2319+
<code>$itemName</code>
2320+
<code>$itemName</code>
2321+
<code>$itemType</code>
2322+
<code>$itemType</code>
2323+
</MixedArgument>
2324+
<MixedAssignment occurrences="5">
2325+
<code>$dbName</code>
2326+
<code>$getNaviSettings</code>
2327+
<code>$itemName</code>
2328+
<code>$itemType</code>
2329+
<code>$tableName</code>
2330+
</MixedAssignment>
23332331
</file>
23342332
<file src="libraries/classes/Controllers/Normalization/FirstNormalForm/FirstStepController.php">
23352333
<MixedArgument occurrences="1">
@@ -2748,55 +2746,40 @@
27482746
</MixedAssignment>
27492747
</file>
27502748
<file src="libraries/classes/Controllers/Server/Status/Monitor/ChartingDataController.php">
2749+
<MixedArgument occurrences="1">
2750+
<code>$params['requiredData'] ?? ''</code>
2751+
</MixedArgument>
27512752
<MixedAssignment occurrences="1">
27522753
<code>$GLOBALS['errorUrl']</code>
27532754
</MixedAssignment>
2754-
<PossiblyInvalidArgument occurrences="1">
2755-
<code>$params['requiredData'] ?? ''</code>
2756-
</PossiblyInvalidArgument>
2757-
<PossiblyInvalidCast occurrences="1">
2758-
<code>$params['requiredData'] ?? ''</code>
2759-
</PossiblyInvalidCast>
27602755
</file>
27612756
<file src="libraries/classes/Controllers/Server/Status/Monitor/GeneralLogController.php">
27622757
<MixedAssignment occurrences="1">
27632758
<code>$GLOBALS['errorUrl']</code>
27642759
</MixedAssignment>
2765-
<RiskyCast occurrences="2">
2766-
<code>$params['time_end']</code>
2767-
<code>$params['time_start']</code>
2768-
</RiskyCast>
27692760
</file>
27702761
<file src="libraries/classes/Controllers/Server/Status/Monitor/LogVarsController.php">
2762+
<MixedArgument occurrences="2">
2763+
<code>$params['varName']</code>
2764+
<code>$params['varValue']</code>
2765+
</MixedArgument>
27712766
<MixedAssignment occurrences="1">
27722767
<code>$GLOBALS['errorUrl']</code>
27732768
</MixedAssignment>
2774-
<PossiblyInvalidArgument occurrences="2">
2775-
<code>$params['varName']</code>
2776-
<code>$params['varValue']</code>
2777-
</PossiblyInvalidArgument>
27782769
</file>
27792770
<file src="libraries/classes/Controllers/Server/Status/Monitor/QueryAnalyzerController.php">
2771+
<MixedArgument occurrences="2">
2772+
<code>$params['database'] ?? ''</code>
2773+
<code>$params['query'] ?? ''</code>
2774+
</MixedArgument>
27802775
<MixedAssignment occurrences="1">
27812776
<code>$GLOBALS['errorUrl']</code>
27822777
</MixedAssignment>
2783-
<PossiblyInvalidArgument occurrences="2">
2784-
<code>$params['database'] ?? ''</code>
2785-
<code>$params['query'] ?? ''</code>
2786-
</PossiblyInvalidArgument>
2787-
<PossiblyInvalidCast occurrences="2">
2788-
<code>$params['database'] ?? ''</code>
2789-
<code>$params['query'] ?? ''</code>
2790-
</PossiblyInvalidCast>
27912778
</file>
27922779
<file src="libraries/classes/Controllers/Server/Status/Monitor/SlowLogController.php">
27932780
<MixedAssignment occurrences="1">
27942781
<code>$GLOBALS['errorUrl']</code>
27952782
</MixedAssignment>
2796-
<RiskyCast occurrences="2">
2797-
<code>$params['time_end']</code>
2798-
<code>$params['time_start']</code>
2799-
</RiskyCast>
28002783
</file>
28012784
<file src="libraries/classes/Controllers/Server/Status/QueriesController.php">
28022785
<MixedArgumentTypeCoercion occurrences="1">
@@ -2820,7 +2803,9 @@
28202803
</MixedOperand>
28212804
</file>
28222805
<file src="libraries/classes/Controllers/Server/Status/StatusController.php">
2823-
<MixedArgument occurrences="17">
2806+
<MixedArgument occurrences="19">
2807+
<code>$primaryConnection</code>
2808+
<code>$primaryConnection</code>
28242809
<code>$this-&gt;data-&gt;status['Aborted_clients']</code>
28252810
<code>$this-&gt;data-&gt;status['Aborted_clients'] * $hourFactor</code>
28262811
<code>$this-&gt;data-&gt;status['Aborted_clients'] * 100 / $this-&gt;data-&gt;status['Connections']</code>
@@ -2839,9 +2824,10 @@
28392824
<code>$this-&gt;data-&gt;status['Uptime']</code>
28402825
<code>($this-&gt;data-&gt;status['Bytes_received'] + $this-&gt;data-&gt;status['Bytes_sent']) * $hourFactor</code>
28412826
</MixedArgument>
2842-
<MixedAssignment occurrences="2">
2827+
<MixedAssignment occurrences="3">
28432828
<code>$hourFactor</code>
28442829
<code>$hourFactor</code>
2830+
<code>$primaryConnection</code>
28452831
</MixedAssignment>
28462832
<MixedOperand occurrences="13">
28472833
<code>$this-&gt;data-&gt;status['Aborted_clients']</code>
@@ -2858,12 +2844,11 @@
28582844
<code>$this-&gt;data-&gt;status['Uptime']</code>
28592845
<code>$this-&gt;data-&gt;status['Uptime']</code>
28602846
</MixedOperand>
2861-
<PossiblyInvalidArgument occurrences="2">
2862-
<code>$_POST['primary_connection'] ?? null</code>
2863-
<code>$_POST['primary_connection'] ?? null</code>
2864-
</PossiblyInvalidArgument>
28652847
</file>
28662848
<file src="libraries/classes/Controllers/Server/Status/VariablesController.php">
2849+
<MixedArgument occurrences="1">
2850+
<code>$params['flush']</code>
2851+
</MixedArgument>
28672852
<MixedArgumentTypeCoercion occurrences="2">
28682853
<code>$name</code>
28692854
<code>$name</code>
@@ -2882,12 +2867,6 @@
28822867
<code>$this-&gt;data-&gt;status['Qcache_total_blocks']</code>
28832868
<code>$this-&gt;data-&gt;variables['thread_cache_size']</code>
28842869
</MixedOperand>
2885-
<PossiblyInvalidArgument occurrences="1">
2886-
<code>$params['flush']</code>
2887-
</PossiblyInvalidArgument>
2888-
<PossiblyInvalidCast occurrences="1">
2889-
<code>$params['flush']</code>
2890-
</PossiblyInvalidCast>
28912870
<UnusedForeachValue occurrences="3">
28922871
<code>$linkUrl</code>
28932872
<code>$sectionLinks</code>

test/classes/Controllers/Server/Status/Monitor/LogVarsControllerTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ public function testLogVars(): void
7373
['varName', null, 'varName'],
7474
]);
7575

76-
7776
$this->dummyDbi->addSelectDb('mysql');
7877
$controller($request);
7978
$this->dummyDbi->assertAllSelectsConsumed();

0 commit comments

Comments
 (0)