mirror of
https://github.com/rectorphp/rector.git
synced 2025-03-13 20:12:07 +01:00
Updated Rector to commit 78382d288119533208cee5bd2827bdf0222f4064
78382d2881
Skip hexa chars in EncapsedStringsToSprintfRector (#6719)
This commit is contained in:
parent
7af22161c0
commit
7fb6abc4ae
@ -97,7 +97,18 @@ CODE_SAMPLE
|
||||
}
|
||||
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 @@ CODE_SAMPLE
|
||||
$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]#');
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user