From 285e31f4c7435e10d52de582e2d31accfcc52b7a Mon Sep 17 00:00:00 2001 From: Andre Klapper Date: Mon, 30 Sep 2024 15:36:10 +0200 Subject: [PATCH] Fix invalid constructor call for ArcanistHardpointFutureList Summary: `ArcanistHardpointFutureList` does not have a constructor and must be instantiated without any parameters. As the code checks `if ($result instanceof Future)` and tries to pass `$result` as a parameter, the intention seems to be calling `newFromFutures($result)` on the new `ArcanistHardpointFutureList` instance. Closes T15836 Test Plan: Read the code in `ArcanistHardpointFutureList`. Reviewers: O1 Blessed Committers, valerio.bozzolan Reviewed By: O1 Blessed Committers, valerio.bozzolan Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno Maniphest Tasks: T15836 Differential Revision: https://we.phorge.it/D25708 --- src/hardpoint/ArcanistHardpointTask.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hardpoint/ArcanistHardpointTask.php b/src/hardpoint/ArcanistHardpointTask.php index e78e0737..5f63f75f 100644 --- a/src/hardpoint/ArcanistHardpointTask.php +++ b/src/hardpoint/ArcanistHardpointTask.php @@ -105,7 +105,8 @@ final class ArcanistHardpointTask $result = $generator->current(); if ($result instanceof Future) { - $result = new ArcanistHardpointFutureList($result); + $result = + ArcanistHardpointFutureList::newFromFutures(array($result)); } if ($result instanceof ArcanistHardpointFutureList) {