diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index f3d8bbb4d00..c8bb54e6569 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 = '49e323a7e24658e84f5d60fcfde83c4e9c652183'; + public const PACKAGE_VERSION = '8f5ac731d7ea25fb4b55ed36c2d5a5451acea43c'; /** * @api * @var string */ - public const RELEASE_DATE = '2025-02-02 00:33:37'; + public const RELEASE_DATE = '2025-02-02 09:11:39'; /** * @var int */ diff --git a/src/PhpParser/Printer/BetterStandardPrinter.php b/src/PhpParser/Printer/BetterStandardPrinter.php index 1b48131a4fa..faf48e339b1 100644 --- a/src/PhpParser/Printer/BetterStandardPrinter.php +++ b/src/PhpParser/Printer/BetterStandardPrinter.php @@ -309,19 +309,19 @@ protected function pScalar_Int(Int_ $int) : string } protected function pExpr_MethodCall(MethodCall $methodCall) : string { + if (!$methodCall->var instanceof CallLike) { + return parent::pExpr_MethodCall($methodCall); + } if (SimpleParameterProvider::provideBoolParameter(Option::NEW_LINE_ON_FLUENT_CALL) === \false) { return parent::pExpr_MethodCall($methodCall); } - if ($methodCall->var instanceof CallLike) { - foreach ($methodCall->args as $arg) { - if (!$arg instanceof Arg) { - continue; - } - $arg->value->setAttribute(AttributeKey::ORIGINAL_NODE, null); + foreach ($methodCall->args as $arg) { + if (!$arg instanceof Arg) { + continue; } - return $this->pDereferenceLhs($methodCall->var) . "\n" . $this->resolveIndentSpaces() . '->' . $this->pObjectProperty($methodCall->name) . '(' . $this->pMaybeMultiline($methodCall->args) . ')'; + $arg->value->setAttribute(AttributeKey::ORIGINAL_NODE, null); } - return parent::pExpr_MethodCall($methodCall); + return $this->pDereferenceLhs($methodCall->var) . "\n" . $this->resolveIndentSpaces() . '->' . $this->pObjectProperty($methodCall->name) . '(' . $this->pMaybeMultiline($methodCall->args) . ')'; } /** * Keep attributes on newlines