From e26cfd53d7689c9229e6a0386df20f1ef0c9f4d3 Mon Sep 17 00:00:00 2001 From: Tigrov Date: Mon, 29 Jan 2024 21:12:21 +0700 Subject: [PATCH] Revert some changes and add suppression of `RiskyTruthyFalsyComparison` to config --- psalm.xml | 1 + src/DDLQueryBuilder.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/psalm.xml b/psalm.xml index 10d319ae..906206a6 100644 --- a/psalm.xml +++ b/psalm.xml @@ -15,5 +15,6 @@ + diff --git a/src/DDLQueryBuilder.php b/src/DDLQueryBuilder.php index c8f44fdf..15b8cd92 100644 --- a/src/DDLQueryBuilder.php +++ b/src/DDLQueryBuilder.php @@ -105,8 +105,8 @@ public function createIndex( [$schema, $table] = $tableParts; } - return 'CREATE ' . ($indexType !== null ? $indexType . ' ' : '') . 'INDEX ' - . $this->quoter->quoteTableName(($schema !== null ? $schema . '.' : '') . $name) + return 'CREATE ' . (!empty($indexType) ? $indexType . ' ' : '') . 'INDEX ' + . $this->quoter->quoteTableName((!empty($schema) ? $schema . '.' : '') . $name) . ' ON ' . $this->quoter->quoteTableName($table) . ' (' . $this->queryBuilder->buildColumns($columns) . ')';