Skip to content

Commit e2b5e28

Browse files
authored
Merge pull request #219 from simon-mundy/qa/mago-sql-column-reference-cast
Drop the redundant isIdentifier cast in resolveColumnValue()
2 parents 8b08e6e + 1f839db commit e2b5e28

2 files changed

Lines changed: 1 addition & 7 deletions

File tree

‎analyzer-baseline.toml‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1842,12 +1842,6 @@ code = "possibly-undefined-string-array-index"
18421842
message = 'Possibly undefined array key `string` accessed on `non-empty-array<string, PhpDb\Sql\Expression|PhpDb\Sql\Select|PhpDb\Sql\TableIdentifier|string>`.'
18431843
count = 1
18441844

1845-
[[issues]]
1846-
file = "src/Sql/AbstractSql.php"
1847-
code = "redundant-cast"
1848-
message = "Redundant cast to `(bool)`: the expression already has this type."
1849-
count = 1
1850-
18511845
[[issues]]
18521846
file = "src/Sql/AbstractSql.php"
18531847
code = "redundant-cast"

‎src/Sql/AbstractSql.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ protected function resolveColumnValue(
443443
$isIdentifier = false;
444444
$fromTable = '';
445445
if (is_array($column)) {
446-
$isIdentifier = (bool) ($column['isIdentifier'] ?? false);
446+
$isIdentifier = $column['isIdentifier'] ?? false;
447447
$fromTable = $column['fromTable'] ?? '';
448448
$column = $column['column'];
449449
}

0 commit comments

Comments
 (0)