Skip to content

Commit

Permalink
fixup! Trim SQL file content and update SQL query handling
Browse files Browse the repository at this point in the history
  • Loading branch information
koriym committed Jun 12, 2024
1 parent 3f96b60 commit 98977c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/SqlQueryRowList.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function __invoke(array ...$queries): iterable
$lastQuery = $result
? strtolower(trim((string) $result->queryString, "\\ \t\n\r\0\x0B")) : '';
// Remove leading comment
$sqlQuery = trim(preg_replace('/^\/\*.*\*\//', '', $lastQuery));
$sqlQuery = trim((string) preg_replace('/^\/\*.*\*\//', '', $lastQuery));
if ($result instanceof PDOStatement && strpos($sqlQuery, 'select') === 0) {
return (array) $result->fetchAll(PDO::FETCH_ASSOC);
}
Expand Down

0 comments on commit 98977c8

Please sign in to comment.