From 6ddb4992d10d354542a3dd9ee39d453a9e564dbb Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Thu, 21 Nov 2024 12:41:02 +0000 Subject: [PATCH] Updated Rector to commit 50496986f393c0ce7406301b7fe6887dfb7986f8 https://github.com/rectorphp/rector-src/commit/50496986f393c0ce7406301b7fe6887dfb7986f8 [Renaming] Fix space on union docblock during rename on RenameClassRector (#6463) --- rules/CodingStyle/ClassNameImport/ValueObject/UsedImports.php | 2 +- rules/TypeDeclaration/ValueObject/DataProviderNodes.php | 2 +- src/Application/VersionResolver.php | 4 ++-- .../PhpDocNodeVisitor/UnionTypeNodePhpDocNodeVisitor.php | 4 +++- src/PhpParser/ValueObject/StmtsAndTokens.php | 2 +- .../rules/Configs/ValueObject/ServiceArguments.php | 4 ++-- 6 files changed, 10 insertions(+), 8 deletions(-) diff --git a/rules/CodingStyle/ClassNameImport/ValueObject/UsedImports.php b/rules/CodingStyle/ClassNameImport/ValueObject/UsedImports.php index f219b4dded8..b779408ec0e 100644 --- a/rules/CodingStyle/ClassNameImport/ValueObject/UsedImports.php +++ b/rules/CodingStyle/ClassNameImport/ValueObject/UsedImports.php @@ -8,7 +8,7 @@ use Rector\StaticTypeMapper\ValueObject\Type\FullyQualifiedObjectType; final class UsedImports { /** - * @var array<(FullyQualifiedObjectType | AliasedObjectType)> + * @var array * @readonly */ private array $useImports; diff --git a/rules/TypeDeclaration/ValueObject/DataProviderNodes.php b/rules/TypeDeclaration/ValueObject/DataProviderNodes.php index 63829fd69de..6c820689f89 100644 --- a/rules/TypeDeclaration/ValueObject/DataProviderNodes.php +++ b/rules/TypeDeclaration/ValueObject/DataProviderNodes.php @@ -8,7 +8,7 @@ use PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocTagNode; final class DataProviderNodes { /** - * @var array + * @var array * @readonly */ public array $nodes; diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index 954a8b3a80d..9bace346bb6 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 = '401210e8630b280a0c84c3de31115e0fe63ada81'; + public const PACKAGE_VERSION = '50496986f393c0ce7406301b7fe6887dfb7986f8'; /** * @api * @var string */ - public const RELEASE_DATE = '2024-11-21 11:07:57'; + public const RELEASE_DATE = '2024-11-21 19:38:41'; /** * @var int */ diff --git a/src/BetterPhpDocParser/PhpDocNodeVisitor/UnionTypeNodePhpDocNodeVisitor.php b/src/BetterPhpDocParser/PhpDocNodeVisitor/UnionTypeNodePhpDocNodeVisitor.php index eb43d5f0f69..f6bd40c6995 100644 --- a/src/BetterPhpDocParser/PhpDocNodeVisitor/UnionTypeNodePhpDocNodeVisitor.php +++ b/src/BetterPhpDocParser/PhpDocNodeVisitor/UnionTypeNodePhpDocNodeVisitor.php @@ -39,7 +39,9 @@ final class UnionTypeNodePhpDocNodeVisitor extends AbstractPhpDocNodeVisitor imp } $startAndEnd = $this->resolveStardAndEnd($node); if (!$startAndEnd instanceof StartAndEnd) { - return null; + $firstKey = \array_key_first($node->types); + $lastKey = \array_key_last($node->types); + $startAndEnd = new StartAndEnd($node->types[$firstKey]->getAttribute('startIndex'), $node->types[$lastKey]->getAttribute('endIndex')); } $betterTokenProvider = $this->currentTokenIteratorProvider->provide(); $isWrappedInCurlyBrackets = $this->isWrappedInCurlyBrackets($betterTokenProvider, $startAndEnd); diff --git a/src/PhpParser/ValueObject/StmtsAndTokens.php b/src/PhpParser/ValueObject/StmtsAndTokens.php index de281d8ec49..eef60dd2b17 100644 --- a/src/PhpParser/ValueObject/StmtsAndTokens.php +++ b/src/PhpParser/ValueObject/StmtsAndTokens.php @@ -12,7 +12,7 @@ final class StmtsAndTokens */ private array $stmts; /** - * @var array + * @var array * @readonly */ private array $tokens; diff --git a/vendor/rector/rector-symfony/rules/Configs/ValueObject/ServiceArguments.php b/vendor/rector/rector-symfony/rules/Configs/ValueObject/ServiceArguments.php index 2e383a15a17..f5ef3f98372 100644 --- a/vendor/rector/rector-symfony/rules/Configs/ValueObject/ServiceArguments.php +++ b/vendor/rector/rector-symfony/rules/Configs/ValueObject/ServiceArguments.php @@ -11,12 +11,12 @@ final class ServiceArguments */ private string $className; /** - * @var array<(string | int), (string | Expr)> + * @var array * @readonly */ private array $params; /** - * @var array<(string | int), (string | Expr)> + * @var array * @readonly */ private array $envs;