From 743f570f664162a61862559859934ef3df00892f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20B=C3=B6sing?= <2189546+boesing@users.noreply.github.com> Date: Mon, 15 Nov 2021 18:06:24 +0100 Subject: [PATCH] bugfix: remove `preg_quote` as that will also quote wildcard MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com> --- src/Psalm/Internal/Type/SimpleAssertionReconciler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Psalm/Internal/Type/SimpleAssertionReconciler.php b/src/Psalm/Internal/Type/SimpleAssertionReconciler.php index 2da742187..4fffca2b5 100644 --- a/src/Psalm/Internal/Type/SimpleAssertionReconciler.php +++ b/src/Psalm/Internal/Type/SimpleAssertionReconciler.php @@ -2420,7 +2420,7 @@ class SimpleAssertionReconciler extends \Psalm\Type\Reconciler return $existing_type; } - $constant_regex_pattern = sprintf('#^%s$#', preg_quote(str_replace('*', '.*', $constant_pattern), '#')); + $constant_regex_pattern = sprintf('#^%s$#', str_replace('*', '.*', $constant_pattern)); $class_like_storage = $codebase->classlike_storage_provider->get($class_name); $matched_class_constant_types = [];