Page MenuHomePhabricator

D13721.diff
No OneTemporary

D13721.diff

diff --git a/src/applications/releeph/controller/branch/ReleephBranchAccessController.php b/src/applications/releeph/controller/branch/ReleephBranchAccessController.php
--- 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 @@
}
$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
--- 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
--- 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 @@
PhabricatorPolicyCapability::CAN_VIEW,
PhabricatorPolicyCapability::CAN_EDIT,
))
- ->withIDs(array($this->branchID))
+ ->withIDs(array($id))
->executeOne();
if (!$branch) {
return new Aphront404Response();
@@ -40,8 +34,7 @@
$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
--- 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
--- 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
--- 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 @@
$controller = id(new PhabricatorApplicationSearchController())
->setPreface($this->renderPreface())
- ->setQueryKey($this->queryKey)
+ ->setQueryKey($querykey)
->setSearchEngine($this->getSearchEngine())
->setNavigation($this->buildSideNavView());

File Metadata

Mime Type
text/plain
Expires
Tue, Nov 12, 3:45 PM (1 w, 14 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6716762
Default Alt Text
D13721.diff (6 KB)

Event Timeline