Skip to content

Commit 787cbb4

Browse files
Replace switch statement with match expression
1 parent d827f58 commit 787cbb4

1 file changed

Lines changed: 6 additions & 10 deletions

File tree

src/QueryBuilder.php

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -163,16 +163,12 @@ public function __construct(Adapter $adapter)
163163
*/
164164
public function assemble(Delete|Insert|Select|Update $stmt): array
165165
{
166-
switch (true) {
167-
case $stmt instanceof Delete:
168-
return $this->assembleDelete($stmt);
169-
case $stmt instanceof Insert:
170-
return $this->assembleInsert($stmt);
171-
case $stmt instanceof Select:
172-
return $this->assembleSelect($stmt);
173-
case $stmt instanceof Update:
174-
return $this->assembleUpdate($stmt);
175-
}
166+
return match (true) {
167+
$stmt instanceof Delete => $this->assembleDelete($stmt),
168+
$stmt instanceof Insert => $this->assembleInsert($stmt),
169+
$stmt instanceof Select => $this->assembleSelect($stmt),
170+
$stmt instanceof Update => $this->assembleUpdate($stmt)
171+
};
176172
}
177173

178174
/**

0 commit comments

Comments
 (0)