diff --git a/src/applications/releeph/controller/branch/ReleephBranchAccessController.php b/src/applications/releeph/controller/branch/ReleephBranchAccessController.php index 177fb82c8f..8b675ed2da 100644 --- a/src/applications/releeph/controller/branch/ReleephBranchAccessController.php +++ b/src/applications/releeph/controller/branch/ReleephBranchAccessController.php @@ -2,21 +2,14 @@ final class ReleephBranchAccessController extends ReleephBranchController { - private $action; - private $branchID; - - public function willProcessRequest(array $data) { - $this->action = $data['action']; - $this->branchID = $data['branchID']; - } - - public function processRequest() { - $request = $this->getRequest(); - $viewer = $request->getUser(); + public function handleRequest(AphrontRequest $request) { + $viewer = $request->getViewer(); + $action = $request->getURIData('action'); + $id = $request->getURIData('branchID'); $branch = id(new ReleephBranchQuery()) ->setViewer($viewer) - ->withIDs(array($this->branchID)) + ->withIDs(array($id)) ->requireCapabilities( array( PhabricatorPolicyCapability::CAN_VIEW, @@ -28,7 +21,6 @@ final class ReleephBranchAccessController extends ReleephBranchController { } $this->setBranch($branch); - $action = $this->action; switch ($action) { case 'close': case 're-open': diff --git a/src/applications/releeph/controller/branch/ReleephBranchCreateController.php b/src/applications/releeph/controller/branch/ReleephBranchCreateController.php index 851724c6d9..d13383cc3b 100644 --- a/src/applications/releeph/controller/branch/ReleephBranchCreateController.php +++ b/src/applications/releeph/controller/branch/ReleephBranchCreateController.php @@ -2,19 +2,13 @@ final class ReleephBranchCreateController extends ReleephProductController { - private $productID; - - public function willProcessRequest(array $data) { - $this->productID = $data['projectID']; - } - - public function processRequest() { - $request = $this->getRequest(); - $viewer = $request->getUser(); + public function handleRequest(AphrontRequest $request) { + $viewer = $request->getViewer(); + $id = $request->getURIData('projectID'); $product = id(new ReleephProductQuery()) ->setViewer($viewer) - ->withIDs(array($this->productID)) + ->withIDs(array($id)) ->requireCapabilities( array( PhabricatorPolicyCapability::CAN_VIEW, diff --git a/src/applications/releeph/controller/branch/ReleephBranchEditController.php b/src/applications/releeph/controller/branch/ReleephBranchEditController.php index 000e9535bf..6d66f5d9d5 100644 --- a/src/applications/releeph/controller/branch/ReleephBranchEditController.php +++ b/src/applications/releeph/controller/branch/ReleephBranchEditController.php @@ -2,15 +2,9 @@ final class ReleephBranchEditController extends ReleephBranchController { - private $branchID; - - public function willProcessRequest(array $data) { - $this->branchID = $data['branchID']; - } - - public function processRequest() { - $request = $this->getRequest(); - $viewer = $request->getUser(); + public function handleRequest(AphrontRequest $request) { + $viewer = $request->getViewer(); + $id = $request->getURIData('branchID'); $branch = id(new ReleephBranchQuery()) ->setViewer($viewer) @@ -19,7 +13,7 @@ final class ReleephBranchEditController extends ReleephBranchController { PhabricatorPolicyCapability::CAN_VIEW, PhabricatorPolicyCapability::CAN_EDIT, )) - ->withIDs(array($this->branchID)) + ->withIDs(array($id)) ->executeOne(); if (!$branch) { return new Aphront404Response(); @@ -40,8 +34,7 @@ final class ReleephBranchEditController extends ReleephBranchController { $symbolic_name); $branch->openTransaction(); - $branch - ->setSymbolicName($symbolic_name); + $branch->setSymbolicName($symbolic_name); if ($existing_with_same_symbolic_name) { $existing_with_same_symbolic_name diff --git a/src/applications/releeph/controller/branch/ReleephBranchHistoryController.php b/src/applications/releeph/controller/branch/ReleephBranchHistoryController.php index 46c0b47f6c..a77cdf8fb3 100644 --- a/src/applications/releeph/controller/branch/ReleephBranchHistoryController.php +++ b/src/applications/releeph/controller/branch/ReleephBranchHistoryController.php @@ -2,23 +2,17 @@ final class ReleephBranchHistoryController extends ReleephBranchController { - private $branchID; - public function shouldAllowPublic() { return true; } - public function willProcessRequest(array $data) { - $this->branchID = $data['branchID']; - } - - public function processRequest() { - $request = $this->getRequest(); - $viewer = $request->getUser(); + public function handleRequest(AphrontRequest $request) { + $viewer = $request->getViewer(); + $id = $request->getURIData('branchID'); $branch = id(new ReleephBranchQuery()) ->setViewer($viewer) - ->withIDs(array($this->branchID)) + ->withIDs(array($id)) ->executeOne(); if (!$branch) { return new Aphront404Response(); diff --git a/src/applications/releeph/controller/branch/ReleephBranchNamePreviewController.php b/src/applications/releeph/controller/branch/ReleephBranchNamePreviewController.php index bf429f9034..f2dbd23d8d 100644 --- a/src/applications/releeph/controller/branch/ReleephBranchNamePreviewController.php +++ b/src/applications/releeph/controller/branch/ReleephBranchNamePreviewController.php @@ -3,8 +3,7 @@ final class ReleephBranchNamePreviewController extends ReleephController { - public function processRequest() { - $request = $this->getRequest(); + public function handleRequest(AphrontRequest $request) { $is_symbolic = $request->getBool('isSymbolic'); $template = $request->getStr('template'); diff --git a/src/applications/releeph/controller/branch/ReleephBranchViewController.php b/src/applications/releeph/controller/branch/ReleephBranchViewController.php index 29e0f6d658..11615fe3ed 100644 --- a/src/applications/releeph/controller/branch/ReleephBranchViewController.php +++ b/src/applications/releeph/controller/branch/ReleephBranchViewController.php @@ -2,25 +2,18 @@ final class ReleephBranchViewController extends ReleephBranchController { - private $queryKey; - private $branchID; - public function shouldAllowPublic() { return true; } - public function willProcessRequest(array $data) { - $this->branchID = $data['branchID']; - $this->queryKey = idx($data, 'queryKey'); - } - - public function processRequest() { - $request = $this->getRequest(); - $viewer = $request->getUser(); + public function handleRequest(AphrontRequest $request) { + $viewer = $request->getViewer(); + $id = $request->getURIData('branchID'); + $querykey = $request->getURIData('queryKey'); $branch = id(new ReleephBranchQuery()) ->setViewer($viewer) - ->withIDs(array($this->branchID)) + ->withIDs(array($id)) ->executeOne(); if (!$branch) { return new Aphront404Response(); @@ -29,7 +22,7 @@ final class ReleephBranchViewController extends ReleephBranchController { $controller = id(new PhabricatorApplicationSearchController()) ->setPreface($this->renderPreface()) - ->setQueryKey($this->queryKey) + ->setQueryKey($querykey) ->setSearchEngine($this->getSearchEngine()) ->setNavigation($this->buildSideNavView());