mirror of
https://github.com/rectorphp/rector.git
synced 2025-03-14 20:39:43 +01:00
Updated Rector to commit ef191b00b29ed33a35d83758f3a6a4f728cdc368
ef191b00b2
[Printer] Reuse clean heredoc/nowdoc start indent usage on BetterStandardPrinter (#6486)
This commit is contained in:
parent
faaa1b5c76
commit
168c835540
@ -19,12 +19,12 @@ final class VersionResolver
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = 'a966fc32547f286a7eab86934e503aed8daa4772';
|
||||
public const PACKAGE_VERSION = 'ef191b00b29ed33a35d83758f3a6a4f728cdc368';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2024-11-23 16:33:58';
|
||||
public const RELEASE_DATE = '2024-11-23 16:41:06';
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
|
@ -241,9 +241,7 @@ final class BetterStandardPrinter extends Standard
|
||||
{
|
||||
if ($string->getAttribute(AttributeKey::DOC_INDENTATION) === '__REMOVED__') {
|
||||
$content = parent::pScalar_String($string);
|
||||
$lines = NewLineSplitter::split($content);
|
||||
$trimmedLines = \array_map('ltrim', $lines);
|
||||
return \implode("\n", $trimmedLines);
|
||||
return $this->cleanStartIndentationOnHeredocNowDoc($content);
|
||||
}
|
||||
$isRegularPattern = (bool) $string->getAttribute(AttributeKey::IS_REGULAR_PATTERN, \false);
|
||||
if (!$isRegularPattern) {
|
||||
@ -279,9 +277,7 @@ final class BetterStandardPrinter extends Standard
|
||||
{
|
||||
$content = parent::pScalar_InterpolatedString($interpolatedString);
|
||||
if ($interpolatedString->getAttribute(AttributeKey::DOC_INDENTATION) === '__REMOVED__') {
|
||||
$lines = NewLineSplitter::split($content);
|
||||
$trimmedLines = \array_map('ltrim', $lines);
|
||||
return \implode("\n", $trimmedLines);
|
||||
return $this->cleanStartIndentationOnHeredocNowDoc($content);
|
||||
}
|
||||
return $content;
|
||||
}
|
||||
@ -331,6 +327,12 @@ final class BetterStandardPrinter extends Standard
|
||||
{
|
||||
return $this->pAttrGroups($param->attrGroups) . $this->pModifiers($param->flags) . ($param->type instanceof Node ? $this->p($param->type) . ' ' : '') . ($param->byRef ? '&' : '') . ($param->variadic ? '...' : '') . $this->p($param->var) . ($param->default instanceof Expr ? ' = ' . $this->p($param->default) : '');
|
||||
}
|
||||
private function cleanStartIndentationOnHeredocNowDoc(string $content) : string
|
||||
{
|
||||
$lines = NewLineSplitter::split($content);
|
||||
$trimmedLines = \array_map('ltrim', $lines);
|
||||
return \implode("\n", $trimmedLines);
|
||||
}
|
||||
private function resolveIndentSpaces() : string
|
||||
{
|
||||
$indentSize = SimpleParameterProvider::provideIntParameter(Option::INDENT_SIZE);
|
||||
|
Loading…
x
Reference in New Issue
Block a user