Skip to content

Commit e6351bf

Browse files
committed
fix(database): address join clause review feedbacks
Signed-off-by: memleakd <121398829+memleakd@users.noreply.github.com>
1 parent c0bf639 commit e6351bf

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

‎system/Database/BaseBuilder.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ public function fromSubquery(BaseBuilder $from, string $alias): self
625625
/**
626626
* Generates the JOIN portion of the query
627627
*
628-
* @param Closure(JoinClause): void|RawSql|string $cond
628+
* @param (Closure(JoinClause): void)|RawSql|string $cond
629629
*
630630
* @return $this
631631
*/
@@ -666,7 +666,7 @@ protected function normalizeJoinType(string $type): string
666666
}
667667

668668
/**
669-
* @param Closure(JoinClause): void|RawSql|string $cond
669+
* @param (Closure(JoinClause): void)|RawSql|string $cond
670670
*/
671671
protected function compileJoinCondition(Closure|RawSql|string $cond, bool $escape): string
672672
{

‎system/Database/JoinClause.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
/**
2020
* Builds conditions for a JOIN ON clause.
2121
*/
22-
class JoinClause
22+
final class JoinClause
2323
{
2424
/**
2525
* @var list<string>
@@ -220,7 +220,7 @@ private function whereHaving(string $key, mixed $value, string $type, ?bool $esc
220220
$condition = $this->protectIdentifier($key, $escape) . $operator . " :{$bind}:";
221221
} elseif (preg_match('/\s*(!=|<>|IS(?:\s+NOT)?)\s*$/i', $key, $match, PREG_OFFSET_CAPTURE) === 1) {
222222
$key = substr($key, 0, $match[0][1]);
223-
$operator = $match[1][0] === '=' || strcasecmp($match[1][0], 'IS') === 0 ? ' IS NULL' : ' IS NOT NULL';
223+
$operator = strcasecmp($match[1][0], 'IS') === 0 ? ' IS NULL' : ' IS NOT NULL';
224224
$condition = $this->protectIdentifier($key, $escape) . $operator;
225225
} else {
226226
$condition = $this->protectIdentifier($key, $escape) . ' IS NULL';

‎system/Database/Postgre/Builder.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ protected function _like_statement(?string $prefix, string $column, ?string $not
346346
/**
347347
* Generates the JOIN portion of the query
348348
*
349-
* @param Closure(JoinClause): void|RawSql|string $cond
349+
* @param (Closure(JoinClause): void)|RawSql|string $cond
350350
*
351351
* @return $this
352352
*/

‎system/Database/SQLSRV/Builder.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ protected function _truncate(string $table): string
9898
/**
9999
* Generates the JOIN portion of the query
100100
*
101-
* @param Closure(JoinClause): void|RawSql|string $cond
101+
* @param (Closure(JoinClause): void)|RawSql|string $cond
102102
*
103103
* @return $this
104104
*/

0 commit comments

Comments
 (0)