Detector: PositionalTupleReturnDetector
Report (why the flagged code is CORRECT and the detector is wrong):
This merges four lists of the SAME type into one list of that type — the method returns list and says so. A tuple bundles independent values that the caller takes apart by position; nothing here is taken apart, and every element is interchangeable with every other. The spread is concatenation, not packing.
Cleanest design the reporter can conceive:
A method that returns list building it by spreading the sublists it gathered, each of which is already list. That is what this is.
⚖️ Maintainer litmus: a valid detector-report needs the flagged code to ALREADY BE the
cleanest design. If the design above differs from the flagged code at all, THAT design is
the owed fix — close this report; the fix is still owed.
Where: src/View/Normalizers/RenderableNormalizer.php:223
Code (src/View/Normalizers/RenderableNormalizer.php:223):
220 $renderable->looks(),
221 );
222
→ 223 return [...$asked, ...$puts, ...$goes, ...$looks];
224 }
225
226 /**
227 * What the gesture must bring with it, each named field standing in for a value only the browser has.
228 *
229 * @param class-string<Interaction> $reported
230 * @return array<string, array<string, string>>
231 */
232 private static function asked(string $reported): array
233 {
234 if (! is_a($reported, Carries::class, true))
235 {
236 return [];
237 }
238
239 $asked = [];
240
241 foreach ($reported::carries() as $named => $field)
242 {
243 $asked[$named] = [self::GESTURE => $field];
244 }
245
246 return $asked;
247 }
Filed via commandments report from a consumer project.
Detector:
PositionalTupleReturnDetectorReport (why the flagged code is CORRECT and the detector is wrong):
This merges four lists of the SAME type into one list of that type — the method returns list and says so. A tuple bundles independent values that the caller takes apart by position; nothing here is taken apart, and every element is interchangeable with every other. The spread is concatenation, not packing.
Cleanest design the reporter can conceive:
A method that returns list building it by spreading the sublists it gathered, each of which is already list. That is what this is.
Where:
src/View/Normalizers/RenderableNormalizer.php:223Code (
src/View/Normalizers/RenderableNormalizer.php:223):Filed via
commandments reportfrom a consumer project.