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 :)