Skip to content

[type-coverage] Kick of simpler rule to add @return on known strict scalar iterables #9312

@TomasVotruba

Description

@TomasVotruba

Ref https://x.com/VotrubaT/status/1957124834086858773

Rector should be able to help with know scalar, no-key arrays:

+/**
+ * @return string[] 
+ */
 function (...) {
     $items = [];

     $items[] = 'hey';
    // or any other strict-type assign

     return $items;
 
}

This could be first rule to kick off with. Let's say where it takes us :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions