Skip to content

Commit

Permalink
fix(QueryAnalyzer): Fix anonymous function parameter type
Browse files Browse the repository at this point in the history
- Change the parameter type of the anonymous function in preg_replace_callback to array
  • Loading branch information
guanguans committed Aug 30, 2023
1 parent bc0f0e1 commit 972e051
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@
],
"psalm": "@php ./vendor/bin/psalm",
"psalm-baseline": "@psalm --update-baseline",
"rector": "@php ./vendor/bin/rector --clear-cache --ansi -v",
"rector": "@php ./vendor/bin/rector --ansi -v",
"rector-dry-run": "@rector --dry-run",
"release": "@php ./vendor/bin/monorepo-builder release --ansi -v",
"release-major": "@release major",
Expand Down
2 changes: 1 addition & 1 deletion src/Support/QueryAnalyzer.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public static function highlight(string $sql, array $bindings = [], ?\PDO $pdo =
$sql = htmlspecialchars($sql, ENT_IGNORE);
$sql = preg_replace_callback(
'#(/\\*.+?\\*/)|(\\*\\*.+?\\*\\*)|(?<=[\\s,(])('.static::KEYWORDS1.')(?=[\\s,)])|(?<=[\\s,(=])('.static::KEYWORDS2.')(?=[\\s,)=])#is',
static function ($matches) {
static function (array $matches) {
if (! empty($matches[1])) { // comment
return '<em style="color:gray">'.$matches[1].'</em>';
}
Expand Down

0 comments on commit 972e051

Please sign in to comment.