diff --git a/rules/CodingStyle/Rector/Encapsed/EncapsedStringsToSprintfRector.php b/rules/CodingStyle/Rector/Encapsed/EncapsedStringsToSprintfRector.php index 24dfd56f26b..9fa424ce7a7 100644 --- a/rules/CodingStyle/Rector/Encapsed/EncapsedStringsToSprintfRector.php +++ b/rules/CodingStyle/Rector/Encapsed/EncapsedStringsToSprintfRector.php @@ -97,7 +97,18 @@ public function refactor(Node $node) : ?Node } private function shouldSkip(InterpolatedString $interpolatedString) : bool { - return $interpolatedString->hasAttribute(AttributeKey::DOC_LABEL); + if ($interpolatedString->hasAttribute(AttributeKey::DOC_LABEL)) { + return \true; + } + foreach ($interpolatedString->parts as $part) { + if (!$part instanceof InterpolatedStringPart) { + continue; + } + if ($this->containsASCIIChar($part->value)) { + return \true; + } + } + return \false; } private function collectEncapsedStringPart(InterpolatedStringPart $interpolatedStringPart) : void { @@ -186,4 +197,8 @@ private function createString(string $value) : String_ $kind = \strpos($value, "'") !== \false ? String_::KIND_DOUBLE_QUOTED : String_::KIND_SINGLE_QUOTED; return new String_($value, ['kind' => $kind]); } + private function containsASCIIChar(string $content) : bool + { + return (bool) Strings::match($content, '#[\\x00-\\x08\\x0B\\x0C\\x0E-\\x1F]#'); + } } diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index 012e4287299..33907824cb0 100644 --- a/src/Application/VersionResolver.php +++ b/src/Application/VersionResolver.php @@ -19,12 +19,12 @@ final class VersionResolver * @api * @var string */ - public const PACKAGE_VERSION = '95a145f9311826749ea9e72f44c3a3adb2a030f3'; + public const PACKAGE_VERSION = '78382d288119533208cee5bd2827bdf0222f4064'; /** * @api * @var string */ - public const RELEASE_DATE = '2025-02-05 15:47:13'; + public const RELEASE_DATE = '2025-02-05 15:35:41'; /** * @var int */