Skip to content

Commit d8f0c40

Browse files
Merge pull request #19346 from kamil-tekiela/getReservedColumnNames
Drop getReservedColumnNames()
2 parents fabf58d + 0c84b63 commit d8f0c40

4 files changed

Lines changed: 0 additions & 33 deletions

File tree

phpstan-baseline.neon

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13524,11 +13524,6 @@ parameters:
1352413524
count: 2
1352513525
path: src/Table/Table.php
1352613526

13527-
-
13528-
message: "#^Only booleans are allowed in a negated boolean, int\\|null given\\.$#"
13529-
count: 1
13530-
path: src/Table/Table.php
13531-
1353213527
-
1353313528
message: "#^Only booleans are allowed in an if condition, PhpMyAdmin\\\\Dbal\\\\ResultInterface\\|false given\\.$#"
1353413529
count: 1

psalm-baseline.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10765,7 +10765,6 @@
1076510765
<code><![CDATA[true|Message]]></code>
1076610766
</PossiblyUnusedReturnValue>
1076710767
<RiskyTruthyFalsyComparison>
10768-
<code><![CDATA[! Context::isKeyword($columnName, true)]]></code>
1076910768
<code><![CDATA[empty($existrelForeign[$masterFieldMd5]->onDelete)]]></code>
1077010769
<code><![CDATA[empty($existrelForeign[$masterFieldMd5]->onUpdate)]]></code>
1077110770
</RiskyTruthyFalsyComparison>

src/Table/Table.php

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
use PhpMyAdmin\Message;
2020
use PhpMyAdmin\Query\Compatibility;
2121
use PhpMyAdmin\Query\Generator as QueryGenerator;
22-
use PhpMyAdmin\SqlParser\Context;
2322
use PhpMyAdmin\SqlParser\Parser;
2423
use PhpMyAdmin\SqlParser\Statements\CreateStatement;
2524
use PhpMyAdmin\SqlParser\Utils\ForeignKey;
@@ -1291,28 +1290,6 @@ public function removeUiProp(UiProperty $property): true|Message
12911290
return true;
12921291
}
12931292

1294-
/**
1295-
* Get all column names which are MySQL reserved words
1296-
*
1297-
* @return string[]
1298-
*/
1299-
public function getReservedColumnNames(): array
1300-
{
1301-
$columns = $this->getColumns(false);
1302-
$return = [];
1303-
foreach ($columns as $column) {
1304-
$temp = explode('.', $column);
1305-
$columnName = $temp[2];
1306-
if (! Context::isKeyword($columnName, true)) {
1307-
continue;
1308-
}
1309-
1310-
$return[] = $columnName;
1311-
}
1312-
1313-
return $return;
1314-
}
1315-
13161293
/**
13171294
* Function to get the name and type of the columns of a table
13181295
*

tests/unit/Table/TableTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1228,10 +1228,6 @@ public function testGetColumns(): void
12281228
'`PMA`.`PMA_BookMark`.`ALL`',
12291229
];
12301230
self::assertSame($expect, $return);
1231-
1232-
$return = $table->getReservedColumnNames();
1233-
$expect = ['ACCESSIBLE', 'ADD', 'ALL'];
1234-
self::assertSame($expect, $return);
12351231
}
12361232

12371233
/**

0 commit comments

Comments
 (0)