@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Update Releeph Branch for handleProcess

Summary: Updates Releeph Branch controllers

Test Plan: bounce around releeph, arc lint

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D13721

+25 -60
+5 -13
src/applications/releeph/controller/branch/ReleephBranchAccessController.php
··· 2 2 3 3 final class ReleephBranchAccessController extends ReleephBranchController { 4 4 5 - private $action; 6 - private $branchID; 7 - 8 - public function willProcessRequest(array $data) { 9 - $this->action = $data['action']; 10 - $this->branchID = $data['branchID']; 11 - } 12 - 13 - public function processRequest() { 14 - $request = $this->getRequest(); 15 - $viewer = $request->getUser(); 5 + public function handleRequest(AphrontRequest $request) { 6 + $viewer = $request->getViewer(); 7 + $action = $request->getURIData('action'); 8 + $id = $request->getURIData('branchID'); 16 9 17 10 $branch = id(new ReleephBranchQuery()) 18 11 ->setViewer($viewer) 19 - ->withIDs(array($this->branchID)) 12 + ->withIDs(array($id)) 20 13 ->requireCapabilities( 21 14 array( 22 15 PhabricatorPolicyCapability::CAN_VIEW, ··· 28 21 } 29 22 $this->setBranch($branch); 30 23 31 - $action = $this->action; 32 24 switch ($action) { 33 25 case 'close': 34 26 case 're-open':
+4 -10
src/applications/releeph/controller/branch/ReleephBranchCreateController.php
··· 2 2 3 3 final class ReleephBranchCreateController extends ReleephProductController { 4 4 5 - private $productID; 6 - 7 - public function willProcessRequest(array $data) { 8 - $this->productID = $data['projectID']; 9 - } 10 - 11 - public function processRequest() { 12 - $request = $this->getRequest(); 13 - $viewer = $request->getUser(); 5 + public function handleRequest(AphrontRequest $request) { 6 + $viewer = $request->getViewer(); 7 + $id = $request->getURIData('projectID'); 14 8 15 9 $product = id(new ReleephProductQuery()) 16 10 ->setViewer($viewer) 17 - ->withIDs(array($this->productID)) 11 + ->withIDs(array($id)) 18 12 ->requireCapabilities( 19 13 array( 20 14 PhabricatorPolicyCapability::CAN_VIEW,
+5 -12
src/applications/releeph/controller/branch/ReleephBranchEditController.php
··· 2 2 3 3 final class ReleephBranchEditController extends ReleephBranchController { 4 4 5 - private $branchID; 6 - 7 - public function willProcessRequest(array $data) { 8 - $this->branchID = $data['branchID']; 9 - } 10 - 11 - public function processRequest() { 12 - $request = $this->getRequest(); 13 - $viewer = $request->getUser(); 5 + public function handleRequest(AphrontRequest $request) { 6 + $viewer = $request->getViewer(); 7 + $id = $request->getURIData('branchID'); 14 8 15 9 $branch = id(new ReleephBranchQuery()) 16 10 ->setViewer($viewer) ··· 19 13 PhabricatorPolicyCapability::CAN_VIEW, 20 14 PhabricatorPolicyCapability::CAN_EDIT, 21 15 )) 22 - ->withIDs(array($this->branchID)) 16 + ->withIDs(array($id)) 23 17 ->executeOne(); 24 18 if (!$branch) { 25 19 return new Aphront404Response(); ··· 40 34 $symbolic_name); 41 35 42 36 $branch->openTransaction(); 43 - $branch 44 - ->setSymbolicName($symbolic_name); 37 + $branch->setSymbolicName($symbolic_name); 45 38 46 39 if ($existing_with_same_symbolic_name) { 47 40 $existing_with_same_symbolic_name
+4 -10
src/applications/releeph/controller/branch/ReleephBranchHistoryController.php
··· 2 2 3 3 final class ReleephBranchHistoryController extends ReleephBranchController { 4 4 5 - private $branchID; 6 - 7 5 public function shouldAllowPublic() { 8 6 return true; 9 7 } 10 8 11 - public function willProcessRequest(array $data) { 12 - $this->branchID = $data['branchID']; 13 - } 14 - 15 - public function processRequest() { 16 - $request = $this->getRequest(); 17 - $viewer = $request->getUser(); 9 + public function handleRequest(AphrontRequest $request) { 10 + $viewer = $request->getViewer(); 11 + $id = $request->getURIData('branchID'); 18 12 19 13 $branch = id(new ReleephBranchQuery()) 20 14 ->setViewer($viewer) 21 - ->withIDs(array($this->branchID)) 15 + ->withIDs(array($id)) 22 16 ->executeOne(); 23 17 if (!$branch) { 24 18 return new Aphront404Response();
+1 -2
src/applications/releeph/controller/branch/ReleephBranchNamePreviewController.php
··· 3 3 final class ReleephBranchNamePreviewController 4 4 extends ReleephController { 5 5 6 - public function processRequest() { 7 - $request = $this->getRequest(); 6 + public function handleRequest(AphrontRequest $request) { 8 7 9 8 $is_symbolic = $request->getBool('isSymbolic'); 10 9 $template = $request->getStr('template');
+6 -13
src/applications/releeph/controller/branch/ReleephBranchViewController.php
··· 2 2 3 3 final class ReleephBranchViewController extends ReleephBranchController { 4 4 5 - private $queryKey; 6 - private $branchID; 7 - 8 5 public function shouldAllowPublic() { 9 6 return true; 10 7 } 11 8 12 - public function willProcessRequest(array $data) { 13 - $this->branchID = $data['branchID']; 14 - $this->queryKey = idx($data, 'queryKey'); 15 - } 16 - 17 - public function processRequest() { 18 - $request = $this->getRequest(); 19 - $viewer = $request->getUser(); 9 + public function handleRequest(AphrontRequest $request) { 10 + $viewer = $request->getViewer(); 11 + $id = $request->getURIData('branchID'); 12 + $querykey = $request->getURIData('queryKey'); 20 13 21 14 $branch = id(new ReleephBranchQuery()) 22 15 ->setViewer($viewer) 23 - ->withIDs(array($this->branchID)) 16 + ->withIDs(array($id)) 24 17 ->executeOne(); 25 18 if (!$branch) { 26 19 return new Aphront404Response(); ··· 29 22 30 23 $controller = id(new PhabricatorApplicationSearchController()) 31 24 ->setPreface($this->renderPreface()) 32 - ->setQueryKey($this->queryKey) 25 + ->setQueryKey($querykey) 33 26 ->setSearchEngine($this->getSearchEngine()) 34 27 ->setNavigation($this->buildSideNavView()); 35 28