From 6a21f13d1784c99dfc99fe006c5a1bc23664eea7 Mon Sep 17 00:00:00 2001 From: Dmitrii Derepko Date: Thu, 21 Sep 2023 05:55:54 +0300 Subject: [PATCH] Update strings package --- composer.json | 2 +- src/Helper/BacktraceIgnoreMatcher.php | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/composer.json b/composer.json index 103a792a..e500baf8 100644 --- a/composer.json +++ b/composer.json @@ -38,7 +38,7 @@ "yiisoft/json": "^1.0", "yiisoft/profiler": "^3.0", "yiisoft/proxy": "^1.0.1", - "yiisoft/strings": "^2.0", + "yiisoft/strings": "^2.2", "yiisoft/var-dumper": "^1.0" }, "require-dev": { diff --git a/src/Helper/BacktraceIgnoreMatcher.php b/src/Helper/BacktraceIgnoreMatcher.php index 0130ae71..9e7bd0c8 100644 --- a/src/Helper/BacktraceIgnoreMatcher.php +++ b/src/Helper/BacktraceIgnoreMatcher.php @@ -4,6 +4,8 @@ namespace Yiisoft\Yii\Debug\Helper; +use Yiisoft\Strings\CombinedRegexp; + /** * All backtrace parameters should contain at least 4 elements in the following order: * 0 – Called method @@ -30,11 +32,6 @@ public static function isIgnoredByClass(array $backtrace, array $classes): bool public static function doesStringMatchPattern(string $string, array $patterns): bool { - foreach ($patterns as $ignoredPathPattern) { - if (preg_match($ignoredPathPattern, $string) > 0) { - return true; - } - } - return false; + return (new CombinedRegexp($patterns))->matches($string); } }