Skip to content

Commit ed7a2cd

Browse files
committed
Updated Rector to commit 37a9bb9acea29cd4ef9511744d2ed272f93140b1
rectorphp/rector-src@37a9bb9 [Printer] Skip change new line as space on anonymous class on print (#6958)
1 parent 91e3cc5 commit ed7a2cd

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/Application/VersionResolver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ final class VersionResolver
1919
* @api
2020
* @var string
2121
*/
22-
public const PACKAGE_VERSION = 'd55ac571ba3bae16b9fc7da54ec64828f5223fbf';
22+
public const PACKAGE_VERSION = '37a9bb9acea29cd4ef9511744d2ed272f93140b1';
2323
/**
2424
* @api
2525
* @var string
2626
*/
27-
public const RELEASE_DATE = '2025-06-03 16:16:38';
27+
public const RELEASE_DATE = '2025-06-04 10:30:37';
2828
/**
2929
* @var int
3030
*/

src/PhpParser/Printer/BetterStandardPrinter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ protected function p(Node $node, int $precedence = self::MAX_PRECEDENCE, int $lh
130130
}
131131
$this->wrapBinaryOp($node);
132132
$content = parent::p($node, $precedence, $lhsPrecedence, $parentFormatPreserved);
133-
if ($node instanceof New_ && $node->class instanceof AnonymousClassNode) {
134-
$content = 'new ' . \ltrim($content, 'new ');
133+
if ($node instanceof New_ && $node->class instanceof AnonymousClassNode && \strncmp($content, 'new', \strlen('new')) !== 0) {
134+
$content = 'new ' . $content;
135135
}
136136
return $node->getAttribute(AttributeKey::WRAPPED_IN_PARENTHESES) === \true ? '(' . $content . ')' : $content;
137137
}

0 commit comments

Comments
 (0)