Skip to content

Commit 438a319

Browse files
Merge pull request #20376 from kamil-tekiela/Small-clean-up
Small clean up
2 parents a07e60a + 3a0c78e commit 438a319

6 files changed

Lines changed: 4 additions & 18 deletions

File tree

‎phpstan-baseline.neon‎

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -450,12 +450,6 @@ parameters:
450450
count: 1
451451
path: src/Config/Form.php
452452

453-
-
454-
message: '#^PHPDoc tag @var for variable \$value has no value type specified in iterable type array\.$#'
455-
identifier: missingType.iterableValue
456-
count: 1
457-
path: src/Config/Form.php
458-
459453
-
460454
message: '#^Parameter \#1 \$keys of function array_combine expects an array of values castable to string, list\<mixed\> given\.$#'
461455
identifier: argument.type
@@ -2616,12 +2610,6 @@ parameters:
26162610
count: 1
26172611
path: src/Controllers/Table/ChartController.php
26182612

2619-
-
2620-
message: '#^Construct empty\(\) is not allowed\. Use more strict comparison\.$#'
2621-
identifier: empty.notAllowed
2622-
count: 1
2623-
path: src/Controllers/Table/ChartController.php
2624-
26252613
-
26262614
message: '#^Parameter \#1 \$rowCount of class PhpMyAdmin\\SqlParser\\Components\\Limit constructor expects int\|string, mixed given\.$#'
26272615
identifier: argument.type
@@ -8670,7 +8658,7 @@ parameters:
86708658
-
86718659
message: '#^Construct empty\(\) is not allowed\. Use more strict comparison\.$#'
86728660
identifier: empty.notAllowed
8673-
count: 11
8661+
count: 10
86748662
path: src/Plugins/Export/ExportSql.php
86758663

86768664
-

‎psalm-baseline.xml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1144,7 +1144,6 @@
11441144
<code><![CDATA[int]]></code>
11451145
<code><![CDATA[int]]></code>
11461146
<code><![CDATA[int]]></code>
1147-
<code><![CDATA[int]]></code>
11481147
</UnnecessaryVarAnnotation>
11491148
</file>
11501149
<file src="src/Controllers/Database/TrackingController.php">

‎src/Config/Form.php‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ public function getOptionValueList(string $optionPath): array
137137
}
138138

139139
if (! $hasStringKeys) {
140-
/** @var array $value */
141140
$value = array_combine($keys, $value);
142141
}
143142

‎src/Controllers/Database/StructureController.php‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -884,7 +884,6 @@ private function getValuesForCsvTable(array $currentTable, int $sumSize): array
884884
// Calculate quotes length
885885
$quotesLength = $currentTable['TABLE_ROWS'] * $columnCount * 2;
886886

887-
/** @var int $tblsize */
888887
$tblsize = $dataLength + $quotesLength + $currentTable['TABLE_ROWS'];
889888

890889
$sumSize += $tblsize;

‎src/Controllers/Table/ChartController.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ public function ajax(ServerRequest $request): void
216216
$parser = new Parser(Current::$sqlQuery);
217217
$statement = $parser->statements[0];
218218
assert($statement instanceof SelectStatement);
219-
if (empty($statement->limit)) {
219+
if (! $statement->limit instanceof Limit) {
220220
$statement->limit = new Limit($_REQUEST['session_max_rows'], $_REQUEST['pos']);
221221
} else {
222222
$start = $statement->limit->offset + $_REQUEST['pos'];

‎src/Plugins/Export/ExportSql.php‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
use PhpMyAdmin\Properties\Options\Items\TextPropertyItem;
3636
use PhpMyAdmin\Properties\Plugins\ExportPluginProperties;
3737
use PhpMyAdmin\SqlParser\Components\CreateDefinition;
38+
use PhpMyAdmin\SqlParser\Components\OptionsArray;
3839
use PhpMyAdmin\SqlParser\Context;
3940
use PhpMyAdmin\SqlParser\Parser;
4041
use PhpMyAdmin\SqlParser\Statements\CreateStatement;
@@ -1492,7 +1493,7 @@ public function getTableDef(
14921493
$statement = $parser->statements[0];
14931494
assert($statement instanceof CreateStatement);
14941495

1495-
if (! empty($statement->entityOptions)) {
1496+
if ($statement->entityOptions instanceof OptionsArray) {
14961497
$engine = $statement->entityOptions->get('ENGINE');
14971498
} else {
14981499
$engine = '';

0 commit comments

Comments
 (0)