@@ -754,23 +754,16 @@ protected function compileHaving(array $having)
754
754
// If the having clause is "raw", we can just return the clause straight away
755
755
// without doing any more processing on it. Otherwise, we will compile the
756
756
// clause into SQL based on the components that make it up from builder.
757
- if ($ having ['type ' ] === 'Raw ' ) {
758
- return $ having ['sql ' ];
759
- } elseif ($ having ['type ' ] === 'between ' ) {
760
- return $ this ->compileHavingBetween ($ having );
761
- } elseif ($ having ['type ' ] === 'Null ' ) {
762
- return $ this ->compileHavingNull ($ having );
763
- } elseif ($ having ['type ' ] === 'NotNull ' ) {
764
- return $ this ->compileHavingNotNull ($ having );
765
- } elseif ($ having ['type ' ] === 'bit ' ) {
766
- return $ this ->compileHavingBit ($ having );
767
- } elseif ($ having ['type ' ] === 'Expression ' ) {
768
- return $ this ->compileHavingExpression ($ having );
769
- } elseif ($ having ['type ' ] === 'Nested ' ) {
770
- return $ this ->compileNestedHavings ($ having );
771
- }
772
-
773
- return $ this ->compileBasicHaving ($ having );
757
+ return match ($ having ['type ' ]) {
758
+ 'Raw ' => $ having ['sql ' ],
759
+ 'between ' => $ this ->compileHavingBetween ($ having ),
760
+ 'Null ' => $ this ->compileHavingNull ($ having ),
761
+ 'NotNull ' => $ this ->compileHavingNotNull ($ having ),
762
+ 'bit ' => $ this ->compileHavingBit ($ having ),
763
+ 'Expression ' => $ this ->compileHavingExpression ($ having ),
764
+ 'Nested ' => $ this ->compileNestedHavings ($ having ),
765
+ default => $ this ->compileBasicHaving ($ having ),
766
+ };
774
767
}
775
768
776
769
/**
0 commit comments