1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 04:45:20 +01:00

Suppress errors when validation regexps

This commit is contained in:
Ivan 2022-11-25 17:54:44 +00:00
parent a0e4468a9a
commit ae285a3f9b

View File

@ -434,7 +434,7 @@ class FileFilter
private static function isRegularExpression(string $string): bool
{
set_error_handler(
static fn(): bool => false,
static fn(): bool => true,
E_WARNING
);
$is_regexp = preg_match($string, '') !== false;