Skip to content

Commit abc5d8c

Browse files
committed
fix: error with phpstan with Parameter #2 of function preg_replace_callback expects callable(array<int|string, string>): string, Closure(array): mixed given
1 parent f8fc4de commit abc5d8c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/ErrorTypesParser.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ private static function convertErrorConstants(string $value): string
5454
{
5555
$output = preg_replace_callback('/(E_[A-Z_]+)/', static function (array $matches) {
5656
if (\defined($matches[1])) {
57-
return \constant($matches[1]);
57+
$constant = \constant($matches[1]);
58+
return is_string($constant) ? $constant : (string) $constant;
5859
}
5960

6061
return $matches[0];

0 commit comments

Comments
 (0)