Skip to content

Commit

Permalink
Updated Rector to commit 78382d288119533208cee5bd2827bdf0222f4064
Browse files Browse the repository at this point in the history
rectorphp/rector-src@78382d2 Skip hexa chars in EncapsedStringsToSprintfRector (#6719)
  • Loading branch information
TomasVotruba committed Feb 5, 2025
1 parent 7af2216 commit 7fb6abc
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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]#');
}
}
4 changes: 2 additions & 2 deletions src/Application/VersionResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down

0 comments on commit 7fb6abc

Please sign in to comment.