From e08ae92529ee68dd45e5df06a49ce06789300a31 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Thu, 22 Feb 2024 10:08:06 +0000 Subject: [PATCH] Updated Rector to commit fb312e00c38b17b096a7257151a4ec0571cd8607 https://github.com/rectorphp/rector-src/commit/fb312e00c38b17b096a7257151a4ec0571cd8607 [PHPStanStaticTypeMapper] Avoid double \ prefix on IntersectionTypeMapper (#5656) --- .../RenameFunctionLikeParamWithinCallLikeArgRector.php | 6 ++---- src/Application/VersionResolver.php | 4 ++-- .../ValueObject/Type/FullyQualifiedIdentifierTypeNode.php | 2 +- .../TypeMapper/IntersectionTypeMapper.php | 2 +- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/rules/Renaming/Rector/FunctionLike/RenameFunctionLikeParamWithinCallLikeArgRector.php b/rules/Renaming/Rector/FunctionLike/RenameFunctionLikeParamWithinCallLikeArgRector.php index b6403de2d1e..33860a90bb7 100644 --- a/rules/Renaming/Rector/FunctionLike/RenameFunctionLikeParamWithinCallLikeArgRector.php +++ b/rules/Renaming/Rector/FunctionLike/RenameFunctionLikeParamWithinCallLikeArgRector.php @@ -150,11 +150,9 @@ CODE_SAMPLE private function findArgFromMethodCall(RenameFunctionLikeParamWithinCallLikeArg $renameFunctionLikeParamWithinCallLikeArg, CallLike $callLike) : ?Arg { if (\is_int($renameFunctionLikeParamWithinCallLikeArg->getCallLikePosition())) { - $arg = $this->processPositionalArg($callLike, $renameFunctionLikeParamWithinCallLikeArg); - } else { - $arg = $this->processNamedArg($callLike, $renameFunctionLikeParamWithinCallLikeArg); + return $this->processPositionalArg($callLike, $renameFunctionLikeParamWithinCallLikeArg); } - return $arg; + return $this->processNamedArg($callLike, $renameFunctionLikeParamWithinCallLikeArg); } private function processPositionalArg(CallLike $callLike, RenameFunctionLikeParamWithinCallLikeArg $renameFunctionLikeParamWithinCallLikeArg) : ?Arg { diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index 1cf3992cb8a..dfef81624ba 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 = '18a8aecd13cbe87766c38de95dcba08673493d3a'; + public const PACKAGE_VERSION = 'fb312e00c38b17b096a7257151a4ec0571cd8607'; /** * @api * @var string */ - public const RELEASE_DATE = '2024-02-22 10:07:14'; + public const RELEASE_DATE = '2024-02-22 17:05:46'; /** * @var int */ diff --git a/src/BetterPhpDocParser/ValueObject/Type/FullyQualifiedIdentifierTypeNode.php b/src/BetterPhpDocParser/ValueObject/Type/FullyQualifiedIdentifierTypeNode.php index cd973330a34..916a5e2222e 100644 --- a/src/BetterPhpDocParser/ValueObject/Type/FullyQualifiedIdentifierTypeNode.php +++ b/src/BetterPhpDocParser/ValueObject/Type/FullyQualifiedIdentifierTypeNode.php @@ -9,6 +9,6 @@ final class FullyQualifiedIdentifierTypeNode extends IdentifierTypeNode { public function __toString() : string { - return '\\' . $this->name; + return '\\' . \ltrim($this->name, '\\'); } } diff --git a/src/PHPStanStaticTypeMapper/TypeMapper/IntersectionTypeMapper.php b/src/PHPStanStaticTypeMapper/TypeMapper/IntersectionTypeMapper.php index 12ad33463fa..70ba622423d 100644 --- a/src/PHPStanStaticTypeMapper/TypeMapper/IntersectionTypeMapper.php +++ b/src/PHPStanStaticTypeMapper/TypeMapper/IntersectionTypeMapper.php @@ -55,7 +55,7 @@ final class IntersectionTypeMapper implements TypeMapperInterface $phpDocNodeTraverser = new PhpDocNodeTraverser(); $phpDocNodeTraverser->traverseWithCallable($typeNode, '', static function (AstNode $astNode) : ?IdentifierTypeNode { if ($astNode instanceof IdentifierTypeNode) { - $astNode->name = '\\' . $astNode->name; + $astNode->name = '\\' . \ltrim($astNode->name, '\\'); return $astNode; } return null;