Page MenuHomePhabricator

D13765.diff
No OneTemporary

D13765.diff

diff --git a/src/applications/herald/controller/HeraldDisableController.php b/src/applications/herald/controller/HeraldDisableController.php
--- a/src/applications/herald/controller/HeraldDisableController.php
+++ b/src/applications/herald/controller/HeraldDisableController.php
@@ -2,18 +2,10 @@
final class HeraldDisableController extends HeraldController {
- 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();
- $id = $this->id;
+ public function handleRequest(AphrontRequest $request) {
+ $viewer = $request->getViewer();
+ $id = $request->getURIData('id');
+ $action = $request->getURIData('action');
$rule = id(new HeraldRuleQuery())
->setViewer($viewer)
@@ -35,7 +27,7 @@
$view_uri = $this->getApplicationURI("rule/{$id}/");
- $is_disable = ($this->action === 'disable');
+ $is_disable = ($action === 'disable');
if ($request->isFormPost()) {
$xaction = id(new HeraldRuleTransaction())
diff --git a/src/applications/herald/controller/HeraldNewController.php b/src/applications/herald/controller/HeraldNewController.php
--- a/src/applications/herald/controller/HeraldNewController.php
+++ b/src/applications/herald/controller/HeraldNewController.php
@@ -2,9 +2,8 @@
final class HeraldNewController extends HeraldController {
- public function processRequest() {
- $request = $this->getRequest();
- $viewer = $request->getUser();
+ public function handleRequest(AphrontRequest $request) {
+ $viewer = $request->getViewer();
$content_type_map = HeraldAdapter::getEnabledAdapterMap($viewer);
$rule_type_map = HeraldRuleTypeConfig::getRuleTypeMap();
diff --git a/src/applications/herald/controller/HeraldRuleController.php b/src/applications/herald/controller/HeraldRuleController.php
--- a/src/applications/herald/controller/HeraldRuleController.php
+++ b/src/applications/herald/controller/HeraldRuleController.php
@@ -2,24 +2,16 @@
final class HeraldRuleController extends HeraldController {
- private $id;
- private $filter;
+ public function handleRequest(AphrontRequest $request) {
+ $viewer = $request->getViewer();
+ $id = $request->getURIData('id');
- public function willProcessRequest(array $data) {
- $this->id = (int)idx($data, 'id');
- }
-
- public function processRequest() {
- $request = $this->getRequest();
- $user = $request->getUser();
-
- $content_type_map = HeraldAdapter::getEnabledAdapterMap($user);
+ $content_type_map = HeraldAdapter::getEnabledAdapterMap($viewer);
$rule_type_map = HeraldRuleTypeConfig::getRuleTypeMap();
- if ($this->id) {
- $id = $this->id;
+ if ($id) {
$rule = id(new HeraldRuleQuery())
- ->setViewer($user)
+ ->setViewer($viewer)
->withIDs(array($id))
->requireCapabilities(
array(
@@ -33,7 +25,7 @@
$cancel_uri = $this->getApplicationURI("rule/{$id}/");
} else {
$rule = new HeraldRule();
- $rule->setAuthorPHID($user->getPHID());
+ $rule->setAuthorPHID($viewer->getPHID());
$rule->setMustMatchAll(1);
$content_type = $request->getStr('content_type');
@@ -58,7 +50,7 @@
if ($rule->isObjectRule()) {
$rule->setTriggerObjectPHID($request->getStr('targetPHID'));
$object = id(new PhabricatorObjectQuery())
- ->setViewer($user)
+ ->setViewer($viewer)
->withPHIDs(array($rule->getTriggerObjectPHID()))
->requireCapabilities(
array(
@@ -128,7 +120,7 @@
$rule_type_name = $rule_type_map[$rule->getRuleType()];
$form = id(new AphrontFormView())
- ->setUser($user)
+ ->setUser($viewer)
->setID('herald-rule-edit-form')
->addHiddenInput('content_type', $rule->getContentType())
->addHiddenInput('rule_type', $rule->getRuleType())
diff --git a/src/applications/herald/controller/HeraldRuleListController.php b/src/applications/herald/controller/HeraldRuleListController.php
--- a/src/applications/herald/controller/HeraldRuleListController.php
+++ b/src/applications/herald/controller/HeraldRuleListController.php
@@ -2,19 +2,15 @@
final class HeraldRuleListController extends HeraldController {
- private $queryKey;
-
public function shouldAllowPublic() {
return true;
}
- public function willProcessRequest(array $data) {
- $this->queryKey = idx($data, 'queryKey');
- }
+ public function handleRequest(AphrontRequest $request) {
+ $querykey = $request->getURIData('queryKey');
- public function processRequest() {
$controller = id(new PhabricatorApplicationSearchController())
- ->setQueryKey($this->queryKey)
+ ->setQueryKey($querykey)
->setSearchEngine(new HeraldRuleSearchEngine())
->setNavigation($this->buildSideNavView());
diff --git a/src/applications/herald/controller/HeraldRuleViewController.php b/src/applications/herald/controller/HeraldRuleViewController.php
--- a/src/applications/herald/controller/HeraldRuleViewController.php
+++ b/src/applications/herald/controller/HeraldRuleViewController.php
@@ -2,19 +2,13 @@
final class HeraldRuleViewController extends HeraldController {
- private $id;
-
- public function willProcessRequest(array $data) {
- $this->id = $data['id'];
- }
-
- public function processRequest() {
- $request = $this->getRequest();
- $viewer = $request->getUser();
+ public function handleRequest(AphrontRequest $request) {
+ $viewer = $request->getViewer();
+ $id = $request->getURIData('id');
$rule = id(new HeraldRuleQuery())
->setViewer($viewer)
- ->withIDs(array($this->id))
+ ->withIDs(array($id))
->needConditionsAndActions(true)
->executeOne();
if (!$rule) {
diff --git a/src/applications/herald/controller/HeraldTestConsoleController.php b/src/applications/herald/controller/HeraldTestConsoleController.php
--- a/src/applications/herald/controller/HeraldTestConsoleController.php
+++ b/src/applications/herald/controller/HeraldTestConsoleController.php
@@ -2,13 +2,8 @@
final class HeraldTestConsoleController extends HeraldController {
- public function processRequest() {
-
- $request = $this->getRequest();
- $user = $request->getUser();
-
- $request = $this->getRequest();
-
+ public function handleRequest(AphrontRequest $request) {
+ $viewer = $request->getViewer();
$object_name = trim($request->getStr('object_name'));
$e_name = true;
@@ -21,7 +16,7 @@
if (!$errors) {
$object = id(new PhabricatorObjectQuery())
- ->setViewer($user)
+ ->setViewer($viewer)
->withNames(array($object_name))
->executeOne();
@@ -57,7 +52,7 @@
$adapter->setIsNewObject(false);
$rules = id(new HeraldRuleQuery())
- ->setViewer($user)
+ ->setViewer($viewer)
->withContentTypes(array($adapter->getAdapterContentType()))
->withDisabled(false)
->needConditionsAndActions(true)
@@ -80,7 +75,7 @@
}
$form = id(new AphrontFormView())
- ->setUser($user)
+ ->setUser($viewer)
->appendRemarkupInstructions(
pht(
'Enter an object to test rules for, like a Diffusion commit (e.g., '.
diff --git a/src/applications/herald/controller/HeraldTranscriptListController.php b/src/applications/herald/controller/HeraldTranscriptListController.php
--- a/src/applications/herald/controller/HeraldTranscriptListController.php
+++ b/src/applications/herald/controller/HeraldTranscriptListController.php
@@ -2,8 +2,6 @@
final class HeraldTranscriptListController extends HeraldController {
- private $queryKey;
-
public function buildSideNavView($for_app = false) {
$user = $this->getRequest()->getUser();
@@ -32,13 +30,11 @@
return $crumbs;
}
- public function willProcessRequest(array $data) {
- $this->queryKey = idx($data, 'queryKey');
- }
+ public function handleRequest(AphrontRequest $request) {
+ $querykey = $request->getURIData('queryKey');
- public function processRequest() {
$controller = id(new PhabricatorApplicationSearchController())
- ->setQueryKey($this->queryKey)
+ ->setQueryKey($querykey)
->setSearchEngine(new HeraldTranscriptSearchEngine())
->setNavigation($this->buildSideNavView());

File Metadata

Mime Type
text/plain
Expires
May 28 2024, 1:02 AM (4 w, 4 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6304104
Default Alt Text
D13765.diff (8 KB)

Event Timeline