Skip to content

Commit 655ce1d

Browse files
Merge pull request #18040 from kamil-tekiela/Remove-old-!==-null-check
Remove old !== null check
2 parents 55a6f09 + e37c240 commit 655ce1d

2 files changed

Lines changed: 8 additions & 16 deletions

File tree

libraries/classes/Util.php

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1581,21 +1581,16 @@ public static function expandUserString(
15811581
if (str_contains($string, '@COLUMNS@')) {
15821582
$columnsList = $GLOBALS['dbi']->getColumns($GLOBALS['db'], $GLOBALS['table']);
15831583

1584-
// sometimes the table no longer exists at this point
1585-
if ($columnsList !== null) {
1586-
$columnNames = [];
1587-
foreach ($columnsList as $column) {
1588-
if ($escape !== null) {
1589-
$columnNames[] = self::$escape($column['Field']);
1590-
} else {
1591-
$columnNames[] = $column['Field'];
1592-
}
1584+
$columnNames = [];
1585+
foreach ($columnsList as $column) {
1586+
if ($escape !== null) {
1587+
$columnNames[] = self::$escape($column['Field']);
1588+
} else {
1589+
$columnNames[] = $column['Field'];
15931590
}
1594-
1595-
$replace['@COLUMNS@'] = implode(',', $columnNames);
1596-
} else {
1597-
$replace['@COLUMNS@'] = '*';
15981591
}
1592+
1593+
$replace['@COLUMNS@'] = implode(',', $columnNames);
15991594
}
16001595

16011596
/* Do the replacement */

psalm-baseline.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13895,9 +13895,6 @@
1389513895
<code>(int) $timestamp</code>
1389613896
<code>(int) $timestamp</code>
1389713897
</RedundantCastGivenDocblockType>
13898-
<RedundantCondition occurrences="1">
13899-
<code>$columnsList !== null</code>
13900-
</RedundantCondition>
1390113898
</file>
1390213899
<file src="libraries/classes/Utils/ForeignKey.php">
1390313900
<RedundantCastGivenDocblockType occurrences="1">

0 commit comments

Comments
 (0)