Skip to content

Commit 327b6ac

Browse files
committed
Use null coalesce operator
Signed-off-by: Maurício Meneghini Fauth <[email protected]>
1 parent e860cf9 commit 327b6ac

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

src/Components/IndexHint.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public static function parse(Parser $parser, TokensList $list, array $options =
6969
{
7070
$ret = [];
7171
$expr = new static();
72-
$expr->type = isset($options['type']) ? $options['type'] : null;
72+
$expr->type = $options['type'] ?? null;
7373
/**
7474
* The state of the parser.
7575
*

src/Utils/Misc.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,7 @@ public static function getAliases($statement, $database)
9090
$expr->database : $database;
9191

9292
if (isset($expr->table) && ($expr->table !== '')) {
93-
$thisTable = isset($tables[$thisDb][$expr->table]) ?
94-
$tables[$thisDb][$expr->table] : $expr->table;
93+
$thisTable = $tables[$thisDb][$expr->table] ?? $expr->table;
9594
$retval[$thisDb]['tables'][$thisTable]['columns'][$expr->column] = $expr->alias;
9695
} else {
9796
foreach ($retval[$thisDb]['tables'] as &$table) {

src/Utils/Query.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ public static function getAll($query)
424424
) {
425425
$tableAliases[$expr->alias] = [
426426
$expr->table,
427-
isset($expr->database) ? $expr->database : null,
427+
$expr->database ?? null,
428428
];
429429
}
430430
}
@@ -591,7 +591,7 @@ public static function getClause($statement, $list, $clause, $type = 0, $skipFir
591591
*
592592
* @var int
593593
*/
594-
$clauseIdx = isset($clauses[$clauseType]) ? $clauses[$clauseType] : -1;
594+
$clauseIdx = $clauses[$clauseType] ?? -1;
595595

596596
$firstClauseIdx = $clauseIdx;
597597
$lastClauseIdx = $clauseIdx;

0 commit comments

Comments
 (0)