diff --git a/src/applications/harbormaster/controller/HarbormasterBuildActionController.php b/src/applications/harbormaster/controller/HarbormasterBuildActionController.php --- a/src/applications/harbormaster/controller/HarbormasterBuildActionController.php +++ b/src/applications/harbormaster/controller/HarbormasterBuildActionController.php @@ -3,24 +3,15 @@ final class HarbormasterBuildActionController extends HarbormasterController { - private $id; - private $action; - private $via; - - public function willProcessRequest(array $data) { - $this->id = $data['id']; - $this->action = $data['action']; - $this->via = idx($data, 'via'); - } - - public function processRequest() { - $request = $this->getRequest(); - $viewer = $request->getUser(); - $command = $this->action; + public function handleRequest(AphrontRequest $request) { + $viewer = $this->getViewer(); + $id = $request->getURIData('id'); + $action = $request->getURIData('action'); + $via = $request->getURIData('via'); $build = id(new HarbormasterBuildQuery()) ->setViewer($viewer) - ->withIDs(array($this->id)) + ->withIDs(array($id)) ->requireCapabilities( array( PhabricatorPolicyCapability::CAN_VIEW, @@ -31,7 +22,7 @@ return new Aphront404Response(); } - switch ($command) { + switch ($action) { case HarbormasterBuildCommand::COMMAND_RESTART: $can_issue = $build->canRestartBuild(); break; @@ -48,7 +39,7 @@ return new Aphront400Response(); } - switch ($this->via) { + switch ($via) { case 'buildable': $return_uri = '/'.$build->getBuildable()->getMonogram(); break; @@ -66,14 +57,14 @@ $xaction = id(new HarbormasterBuildTransaction()) ->setTransactionType(HarbormasterBuildTransaction::TYPE_COMMAND) - ->setNewValue($command); + ->setNewValue($action); $editor->applyTransactions($build, array($xaction)); return id(new AphrontRedirectResponse())->setURI($return_uri); } - switch ($command) { + switch ($action) { case HarbormasterBuildCommand::COMMAND_RESTART: if ($can_issue) { $title = pht('Really restart build?'); diff --git a/src/applications/harbormaster/controller/HarbormasterBuildableActionController.php b/src/applications/harbormaster/controller/HarbormasterBuildableActionController.php --- a/src/applications/harbormaster/controller/HarbormasterBuildableActionController.php +++ b/src/applications/harbormaster/controller/HarbormasterBuildableActionController.php @@ -3,22 +3,14 @@ final class HarbormasterBuildableActionController extends HarbormasterController { - private $id; - private $action; - - public function willProcessRequest(array $data) { - $this->id = $data['id']; - $this->action = $data['action']; - } - - public function processRequest() { - $request = $this->getRequest(); - $viewer = $request->getUser(); - $command = $this->action; + public function handleRequest(AphrontRequest $request) { + $viewer = $this->getViewer(); + $id = $request->getURIData('id'); + $action = $request->getURIData('action'); $buildable = id(new HarbormasterBuildableQuery()) ->setViewer($viewer) - ->withIDs(array($this->id)) + ->withIDs(array($id)) ->needBuilds(true) ->requireCapabilities( array( @@ -33,7 +25,7 @@ $issuable = array(); foreach ($buildable->getBuilds() as $build) { - switch ($command) { + switch ($action) { case HarbormasterBuildCommand::COMMAND_RESTART: if ($build->canRestartBuild()) { $issuable[] = $build; @@ -69,7 +61,7 @@ $xaction = id(new HarbormasterBuildableTransaction()) ->setTransactionType(HarbormasterBuildableTransaction::TYPE_COMMAND) - ->setNewValue($command); + ->setNewValue($action); $editor->applyTransactions($buildable, array($xaction)); @@ -82,14 +74,14 @@ foreach ($issuable as $build) { $xaction = id(new HarbormasterBuildTransaction()) ->setTransactionType(HarbormasterBuildTransaction::TYPE_COMMAND) - ->setNewValue($command); + ->setNewValue($action); $build_editor->applyTransactions($build, array($xaction)); } return id(new AphrontRedirectResponse())->setURI($return_uri); } - switch ($command) { + switch ($action) { case HarbormasterBuildCommand::COMMAND_RESTART: if ($issuable) { $title = pht('Really restart all builds?'); diff --git a/src/applications/harbormaster/controller/HarbormasterBuildableListController.php b/src/applications/harbormaster/controller/HarbormasterBuildableListController.php --- a/src/applications/harbormaster/controller/HarbormasterBuildableListController.php +++ b/src/applications/harbormaster/controller/HarbormasterBuildableListController.php @@ -2,19 +2,13 @@ final class HarbormasterBuildableListController extends HarbormasterController { - private $queryKey; - public function shouldAllowPublic() { return true; } - public function willProcessRequest(array $data) { - $this->queryKey = idx($data, 'queryKey'); - } - - public function processRequest() { + public function handleRequest(AphrontRequest $request) { $controller = id(new PhabricatorApplicationSearchController()) - ->setQueryKey($this->queryKey) + ->setQueryKey($request->getURIData('queryKey')) ->setSearchEngine(new HarbormasterBuildableSearchEngine()) ->setNavigation($this->buildSideNavView()); diff --git a/src/applications/harbormaster/controller/HarbormasterPlanViewController.php b/src/applications/harbormaster/controller/HarbormasterPlanViewController.php --- a/src/applications/harbormaster/controller/HarbormasterPlanViewController.php +++ b/src/applications/harbormaster/controller/HarbormasterPlanViewController.php @@ -4,7 +4,6 @@ public function handleRequest(AphrontRequest $request) { $viewer = $this->getviewer(); - $id = $request->getURIData('id'); $plan = id(new HarbormasterBuildPlanQuery()) diff --git a/src/applications/harbormaster/controller/HarbormasterStepEditController.php b/src/applications/harbormaster/controller/HarbormasterStepEditController.php --- a/src/applications/harbormaster/controller/HarbormasterStepEditController.php +++ b/src/applications/harbormaster/controller/HarbormasterStepEditController.php @@ -4,11 +4,11 @@ public function handleRequest(AphrontRequest $request) { $viewer = $this->getViewer(); + $id = $request->getURIData('id'); $this->requireApplicationCapability( HarbormasterManagePlansCapability::CAPABILITY); - $id = $request->getURIData('id'); if ($id) { $step = id(new HarbormasterBuildStepQuery()) ->setViewer($viewer)