@@ -747,7 +747,7 @@ public function orWhere($key, $value = null, ?bool $escape = null)
747747 *
748748 * @throws InvalidArgumentException
749749 */
750- public function whereColumn (string $ first , string $ second , ?bool $ escape = null )
750+ public function whereColumn (string $ first , string $ second , ?bool $ escape = null ): static
751751 {
752752 return $ this ->whereColumnHaving ('QBWhere ' , $ first , $ second , 'AND ' , $ escape );
753753 }
@@ -763,7 +763,7 @@ public function whereColumn(string $first, string $second, ?bool $escape = null)
763763 *
764764 * @throws InvalidArgumentException
765765 */
766- public function orWhereColumn (string $ first , string $ second , ?bool $ escape = null )
766+ public function orWhereColumn (string $ first , string $ second , ?bool $ escape = null ): static
767767 {
768768 return $ this ->whereColumnHaving ('QBWhere ' , $ first , $ second , 'OR ' , $ escape );
769769 }
@@ -782,7 +782,7 @@ public function orWhereColumn(string $first, string $second, ?bool $escape = nul
782782 *
783783 * @throws InvalidArgumentException
784784 */
785- protected function whereColumnHaving (string $ qbKey , string $ first , string $ second , string $ type = 'AND ' , ?bool $ escape = null )
785+ protected function whereColumnHaving (string $ qbKey , string $ first , string $ second , string $ type = 'AND ' , ?bool $ escape = null ): static
786786 {
787787 [$ first , $ operator ] = $ this ->parseWhereColumnFirst ($ first );
788788 $ second = trim ($ second );
@@ -793,9 +793,7 @@ protected function whereColumnHaving(string $qbKey, string $first, string $secon
793793 throw new InvalidArgumentException (sprintf ('%s() expects $first and $second to be non-empty strings ' , $ caller ));
794794 }
795795
796- if (! is_bool ($ escape )) {
797- $ escape = $ this ->db ->protectIdentifiers ;
798- }
796+ $ escape ??= $ this ->db ->protectIdentifiers ;
799797
800798 $ prefix = $ this ->{$ qbKey } === [] ? $ this ->groupGetType ('' ) : $ this ->groupGetType ($ type );
801799
@@ -3278,6 +3276,8 @@ protected function compileWhereHaving(string $qbKey): string
32783276 }
32793277
32803278 /**
3279+ * @used-by compileWhereHaving()
3280+ *
32813281 * @param array{columnComparison: true, condition: string, escape: bool, first: string, operator: string, second: string} $condition
32823282 */
32833283 private function compileColumnComparison (array $ condition ): string
0 commit comments