Skip to content

Commit f380b01

Browse files
Merge pull request #19043 from kamil-tekiela/Update-SA-tools
Update SA tools
2 parents 32b1c17 + cc18b93 commit f380b01

7 files changed

Lines changed: 159 additions & 175 deletions

File tree

composer.lock

Lines changed: 143 additions & 135 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

phpstan-baseline.neon

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9295,6 +9295,11 @@ parameters:
92959295
count: 4
92969296
path: src/Navigation/NavigationTree.php
92979297

9298+
-
9299+
message: "#^Method PhpMyAdmin\\\\Navigation\\\\NavigationTree\\:\\:parsePath\\(\\) should return non\\-empty\\-array\\<int, string\\> but returns non\\-empty\\-array\\<int, string\\|false\\>\\.$#"
9300+
count: 1
9301+
path: src/Navigation/NavigationTree.php
9302+
92989303
-
92999304
message: "#^Only booleans are allowed in &&, int given on the right side\\.$#"
93009305
count: 5
@@ -12915,11 +12920,6 @@ parameters:
1291512920
count: 1
1291612921
path: src/Server/Plugins.php
1291712922

12918-
-
12919-
message: "#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\\.$#"
12920-
count: 1
12921-
path: src/Server/Privileges.php
12922-
1292312923
-
1292412924
message: "#^Cannot access offset 'CHARACTER_MAXIMUM…' on mixed\\.$#"
1292512925
count: 2

psalm-baseline.xml

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<files psalm-version="5.22.2@d768d914152dbbf3486c36398802f74e80cfde48">
2+
<files psalm-version="5.23.0@005e3184fb6de4350a873b9b8c4dc3cede9db762">
33
<file src="app/services_loader.php">
44
<MixedArgument>
55
<code><![CDATA[$argumentName]]></code>
@@ -837,9 +837,6 @@
837837
<code><![CDATA[$userGroups]]></code>
838838
<code><![CDATA[$userGroups[$groupName]]]></code>
839839
</PossiblyNullArrayOffset>
840-
<RiskyTruthyFalsyComparison>
841-
<code><![CDATA[$result->numRows()]]></code>
842-
</RiskyTruthyFalsyComparison>
843840
</file>
844841
<file src="src/Console.php">
845842
<DeprecatedMethod>
@@ -3002,7 +2999,6 @@
30022999
<RiskyTruthyFalsyComparison>
30033000
<code><![CDATA[empty($GLOBALS['back'])]]></code>
30043001
<code><![CDATA[empty($GLOBALS['goto'])]]></code>
3005-
<code><![CDATA[empty($GLOBALS['sql_query'])]]></code>
30063002
</RiskyTruthyFalsyComparison>
30073003
</file>
30083004
<file src="src/Controllers/Table/AddFieldController.php">
@@ -3223,7 +3219,6 @@
32233219
</PossiblyInvalidIterator>
32243220
<RiskyTruthyFalsyComparison>
32253221
<code><![CDATA[$message->isError()]]></code>
3226-
<code><![CDATA[empty($selected)]]></code>
32273222
</RiskyTruthyFalsyComparison>
32283223
<UnusedParam>
32293224
<code><![CDATA[$request]]></code>
@@ -3903,11 +3898,6 @@
39033898
<code><![CDATA[$_POST['field_expression'][$i]]]></code>
39043899
<code><![CDATA[$_POST['field_virtuality'][$i]]]></code>
39053900
</PossiblyInvalidOperand>
3906-
<RiskyTruthyFalsyComparison>
3907-
<code><![CDATA[$_POST['field_virtuality'][$i]]]></code>
3908-
<code><![CDATA[empty($_POST['field_adjust_privileges'][$i])]]></code>
3909-
<code><![CDATA[empty($_POST['field_move_to'][$i])]]></code>
3910-
</RiskyTruthyFalsyComparison>
39113901
</file>
39123902
<file src="src/Controllers/Table/StructureController.php">
39133903
<DeprecatedMethod>
@@ -4228,7 +4218,6 @@
42284218
<code><![CDATA[$array]]></code>
42294219
</PossiblyUnusedParam>
42304220
<RiskyTruthyFalsyComparison>
4231-
<code><![CDATA[! $size]]></code>
42324221
<code><![CDATA[Config::getInstance()->get('is_setup')]]></code>
42334222
<code><![CDATA[empty($_SERVER['REMOTE_ADDR'])]]></code>
42344223
</RiskyTruthyFalsyComparison>
@@ -4564,7 +4553,6 @@
45644553
<code><![CDATA[! empty($indexArray2[$f2])]]></code>
45654554
</RedundantCondition>
45664555
<RiskyTruthyFalsyComparison>
4567-
<code><![CDATA[! $value]]></code>
45684556
<code><![CDATA[$foreigner]]></code>
45694557
</RiskyTruthyFalsyComparison>
45704558
</file>
@@ -4719,6 +4707,8 @@
47194707
<code><![CDATA[$routine['item_param_name'][$i]]]></code>
47204708
<code><![CDATA[$routine['item_param_name'][$i]]]></code>
47214709
<code><![CDATA[$routine['item_param_name'][$i]]]></code>
4710+
<code><![CDATA[$routine['item_param_name'][$i]]]></code>
4711+
<code><![CDATA[$routine['item_param_name'][$i]]]></code>
47224712
<code><![CDATA[$routine['item_param_opts_text'][$i]]]></code>
47234713
<code><![CDATA[$routine['item_param_type'][$i]]]></code>
47244714
<code><![CDATA[$routine['item_param_type'][$i]]]></code>
@@ -4865,7 +4855,6 @@
48654855
</PossiblyUndefinedArrayOffset>
48664856
<RiskyTruthyFalsyComparison>
48674857
<code><![CDATA[empty($_POST['editor_process_edit'])]]></code>
4868-
<code><![CDATA[empty($_POST['funcs'][$routine['item_param_name'][$i]])]]></code>
48694858
<code><![CDATA[empty($_POST['item_adjust_privileges'])]]></code>
48704859
<code><![CDATA[empty($_POST['item_comment'])]]></code>
48714860
<code><![CDATA[empty($_POST['item_returnlength'])]]></code>
@@ -4942,8 +4931,6 @@
49424931
</MixedArrayAssignment>
49434932
<MixedArrayOffset>
49444933
<code><![CDATA[$row[$keyIndex]]]></code>
4945-
<code><![CDATA[$row[$keyIndex]]]></code>
4946-
<code><![CDATA[$row[$keyIndex]]]></code>
49474934
</MixedArrayOffset>
49484935
<MixedAssignment>
49494936
<code><![CDATA[$aLength]]></code>
@@ -6731,9 +6718,6 @@
67316718
<PossiblyFalseOperand>
67326719
<code><![CDATA[mb_strpos($tab, '_')]]></code>
67336720
</PossiblyFalseOperand>
6734-
<RiskyTruthyFalsyComparison>
6735-
<code><![CDATA[empty($binaryLogs)]]></code>
6736-
</RiskyTruthyFalsyComparison>
67376721
</file>
67386722
<file src="src/Message.php">
67396723
<MixedArgument>
@@ -6907,10 +6891,6 @@
69076891
<PossiblyNullOperand>
69086892
<code><![CDATA[$arr[0]]]></code>
69096893
</PossiblyNullOperand>
6910-
<RiskyTruthyFalsyComparison>
6911-
<code><![CDATA[empty($this->config->selectedServer['only_db'])]]></code>
6912-
<code><![CDATA[empty($this->config->selectedServer['only_db'])]]></code>
6913-
</RiskyTruthyFalsyComparison>
69146894
</file>
69156895
<file src="src/Navigation/Nodes/NodeColumn.php">
69166896
<MixedArgument>
@@ -9404,7 +9384,6 @@
94049384
<RiskyTruthyFalsyComparison>
94059385
<code><![CDATA[$foreigner]]></code>
94069386
<code><![CDATA[$foreigner]]></code>
9407-
<code><![CDATA[empty($showComment)]]></code>
94089387
</RiskyTruthyFalsyComparison>
94099388
<UnusedProperty>
94109389
<code><![CDATA[$bottomMargin]]></code>
@@ -10423,9 +10402,6 @@
1042310402
<DeprecatedMethod>
1042410403
<code><![CDATA[Config::getInstance()]]></code>
1042510404
</DeprecatedMethod>
10426-
<RiskyTruthyFalsyComparison>
10427-
<code><![CDATA[empty($server['only_db'])]]></code>
10428-
</RiskyTruthyFalsyComparison>
1042910405
</file>
1043010406
<file src="src/Server/Status/Data.php">
1043110407
<MixedArgumentTypeCoercion>

src/Advisory/Advisor.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function __construct(private DatabaseInterface $dbi, private ExpressionLa
6565
'round',
6666
static function (): void {
6767
},
68-
static fn (array $arguments, float $num): float => round($num)
68+
static fn (array $arguments, float $num): float => round($num),
6969
);
7070
$this->expression->register(
7171
'substr',
@@ -76,7 +76,7 @@ static function (): void {
7676
string $string,
7777
int $start,
7878
int $length,
79-
): string => substr($string, $start, $length)
79+
): string => substr($string, $start, $length),
8080
);
8181
$this->expression->register(
8282
'preg_match',
@@ -92,13 +92,13 @@ static function (): void {
9292
'ADVISOR_bytime',
9393
static function (): void {
9494
},
95-
static fn (array $arguments, float $num, int $precision): string => self::byTime($num, $precision)
95+
static fn (array $arguments, float $num, int $precision): string => self::byTime($num, $precision),
9696
);
9797
$this->expression->register(
9898
'ADVISOR_timespanFormat',
9999
static function (): void {
100100
},
101-
static fn (array $arguments, string $seconds): string => Util::timespanFormat((int) $seconds)
101+
static fn (array $arguments, string $seconds): string => Util::timespanFormat((int) $seconds),
102102
);
103103
$this->expression->register(
104104
'ADVISOR_formatByteDown',
@@ -109,7 +109,7 @@ static function (): void {
109109
int $value,
110110
int $limes = 6,
111111
int $comma = 0,
112-
): string => implode(' ', Util::formatByteDown($value, $limes, $comma))
112+
): string => implode(' ', Util::formatByteDown($value, $limes, $comma)),
113113
);
114114
$this->expression->register(
115115
'fired',

src/Controllers/Table/Structure/ChangeController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ private function displayHtmlForColumnChange(array $selected): void
6868
$fieldsMeta = $this->dbi->getColumns(Current::$database, Current::$table, true);
6969
$fieldsMeta = array_values(array_filter(
7070
$fieldsMeta,
71-
static fn (ColumnFull $column): bool => in_array($column->field, $selected, true)
71+
static fn (ColumnFull $column): bool => in_array($column->field, $selected, true),
7272
));
7373
// TODO: Refactor columnsDefinition->displayForm() method to avoid unwrapping DTO
7474
$fieldsMeta = array_map(static fn (ColumnFull $column): array => [

src/DatabaseInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,7 @@ public function getDatabasesFull(
741741
if ($applyLimitAndOrderManual) {
742742
usort(
743743
$databases,
744-
static fn ($a, $b): int => Utilities::usortComparisonCallback($a, $b, $sortBy, $sortOrder)
744+
static fn ($a, $b): int => Utilities::usortComparisonCallback($a, $b, $sortBy, $sortOrder),
745745
);
746746

747747
/**

src/StorageEngine.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public static function getStorageEngines(): array
103103
/** @return mixed|false */
104104
static fn () => DatabaseInterface::getInstance()->fetchValue(
105105
'SELECT @@disabled_storage_engines',
106-
)
106+
),
107107
);
108108
foreach (explode(',', $disabled) as $engine) {
109109
if (! isset($storageEngines[$engine])) {

0 commit comments

Comments
 (0)