From 2285c9d4bd8e6d3d67285ee4dc604e96f334bf5a Mon Sep 17 00:00:00 2001 From: rhertogh Date: Thu, 6 Jul 2023 23:54:50 +0200 Subject: [PATCH] Fixed codestyle for CommentAnalyzer and use plain instead of multibite string functions --- src/Psalm/Internal/Analyzer/CommentAnalyzer.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Psalm/Internal/Analyzer/CommentAnalyzer.php b/src/Psalm/Internal/Analyzer/CommentAnalyzer.php index ffedcff57..a8c57a2fc 100644 --- a/src/Psalm/Internal/Analyzer/CommentAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/CommentAnalyzer.php @@ -38,6 +38,8 @@ use function substr; use function substr_count; use function trim; +use const PREG_OFFSET_CAPTURE; + /** * @internal */ @@ -264,9 +266,9 @@ class CommentAnalyzer // Strip out remainders of a line when inline comment is encountered inside curly braces. if (preg_match('/{(?>[^{}]|(?R))*}/', $docblock_type, $braceMatches, PREG_OFFSET_CAPTURE)) { $docblock_type = - mb_substr($docblock_type, 0, $braceMatches[0][1]) + substr($docblock_type, 0, $braceMatches[0][1]) . preg_replace('%//.*$%m', '', $braceMatches[0][0]) - . mb_substr($docblock_type, $braceMatches[0][1] + mb_strlen($braceMatches[0][0])); + . substr($docblock_type, $braceMatches[0][1] + strlen($braceMatches[0][0])); } return str_replace("\n", '', $docblock_type);