Skip to content

[TypeDeclaration] Add doc return type only for list and generic arrays in ReturnTypeFromStrictNewArrayRector - #8423

Merged
TomasVotruba merged 2 commits into
mainfrom
union-reservation-array-shapes-fixture
Aug 31, 2026
Merged

[TypeDeclaration] Add doc return type only for list and generic arrays in ReturnTypeFromStrictNewArrayRector#8423
TomasVotruba merged 2 commits into
mainfrom
union-reservation-array-shapes-fixture

Conversation

@TomasVotruba

@TomasVotruba TomasVotruba commented Aug 31, 2026

Copy link
Copy Markdown
Member

Follow-up to #8422.

The rule now adds a doc return type only for plain list<...> and generic array<...>/mixed[] types. Any array shape (array{...}) — single, nested, or a union of several — is skipped: it always keeps the : array native return type but drops the noisy, fragile shape docblock.

Replaces the previous union-only skip with a single hasArrayShape() check that walks the type tree via TypeTraverser. Adds a reservation-style union fixture; updates deep_nested_array (nested shape) to no longer emit a shape docblock.

@TomasVotruba TomasVotruba changed the title [TypeDeclaration] Add fixture for union of reservation-style array shapes [TypeDeclaration] Add doc return type only for list and generic arrays in ReturnTypeFromStrictNewArrayRector Aug 31, 2026
@TomasVotruba
TomasVotruba merged commit eee8f35 into main Aug 31, 2026
44 checks passed
@TomasVotruba
TomasVotruba deleted the union-reservation-array-shapes-fixture branch August 31, 2026 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant