From 96e5264f0569938702d19450e25f409a2bb0cce4 Mon Sep 17 00:00:00 2001 From: vrana Date: Thu, 20 Dec 2012 14:48:23 -0800 Subject: [PATCH] Rename setViewer() to setUser() in views Summary: I prefer consistency. Test Plan: /paste/ Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D4249 --- .../feed/view/PhabricatorFeedStoryView.php | 8 +------- .../controller/PhabricatorFileListController.php | 2 +- .../controller/PhabricatorMacroViewController.php | 2 +- .../controller/PhabricatorPasteListController.php | 2 +- .../phame/controller/PhameController.php | 2 +- .../controller/blog/PhameBlogListController.php | 2 +- src/applications/phame/skins/PhameBasicBlogSkin.php | 2 +- src/applications/phame/view/PhamePostView.php | 12 +----------- .../ponder/controller/PonderFeedController.php | 2 +- .../ponder/view/PonderUserProfileView.php | 2 +- ...pplicationTransactionCommentHistoryController.php | 2 +- src/view/layout/PhabricatorObjectItemListView.php | 10 ---------- 12 files changed, 11 insertions(+), 37 deletions(-) diff --git a/src/applications/feed/view/PhabricatorFeedStoryView.php b/src/applications/feed/view/PhabricatorFeedStoryView.php index eb8fa94fc8..72b4a2a795 100644 --- a/src/applications/feed/view/PhabricatorFeedStoryView.php +++ b/src/applications/feed/view/PhabricatorFeedStoryView.php @@ -6,17 +6,11 @@ final class PhabricatorFeedStoryView extends PhabricatorFeedView { private $image; private $phid; private $epoch; - private $viewer; private $viewed; private $href; private $oneLine; - public function setViewer(PhabricatorUser $viewer) { - $this->viewer = $viewer; - return $this; - } - public function setTitle($title) { $this->title = $title; return $this; @@ -98,7 +92,7 @@ final class PhabricatorFeedStoryView extends PhabricatorFeedView { $this->renderChildren()); if ($this->epoch) { - $foot = phabricator_datetime($this->epoch, $this->viewer); + $foot = phabricator_datetime($this->epoch, $this->user); } else { $foot = ''; } diff --git a/src/applications/files/controller/PhabricatorFileListController.php b/src/applications/files/controller/PhabricatorFileListController.php index ecdaba4d6b..5e31eb3554 100644 --- a/src/applications/files/controller/PhabricatorFileListController.php +++ b/src/applications/files/controller/PhabricatorFileListController.php @@ -83,7 +83,7 @@ final class PhabricatorFileListController extends PhabricatorFileController { $highlighted_ids = array_fill_keys($highlighted_ids, true); $list_view = id(new PhabricatorObjectItemListView()) - ->setViewer($user); + ->setUser($user); foreach ($files as $file) { $id = $file->getID(); diff --git a/src/applications/macro/controller/PhabricatorMacroViewController.php b/src/applications/macro/controller/PhabricatorMacroViewController.php index b7fb10d963..970d6e48da 100644 --- a/src/applications/macro/controller/PhabricatorMacroViewController.php +++ b/src/applications/macro/controller/PhabricatorMacroViewController.php @@ -56,7 +56,7 @@ final class PhabricatorMacroViewController $engine->process(); $timeline = id(new PhabricatorApplicationTransactionView()) - ->setViewer($user) + ->setUser($user) ->setTransactions($xactions) ->setMarkupEngine($engine); diff --git a/src/applications/paste/controller/PhabricatorPasteListController.php b/src/applications/paste/controller/PhabricatorPasteListController.php index 45fb6b6fe3..01f4c5907f 100644 --- a/src/applications/paste/controller/PhabricatorPasteListController.php +++ b/src/applications/paste/controller/PhabricatorPasteListController.php @@ -80,7 +80,7 @@ final class PhabricatorPasteListController extends PhabricatorPasteController { $lang_map = PhabricatorEnv::getEnvConfig('pygments.dropdown-choices'); $list = new PhabricatorObjectItemListView(); - $list->setViewer($user); + $list->setUser($user); foreach ($pastes as $paste) { $created = phabricator_date($paste->getDateCreated(), $user); $author = $this->getHandle($paste->getAuthorPHID())->renderLink(); diff --git a/src/applications/phame/controller/PhameController.php b/src/applications/phame/controller/PhameController.php index 8993900bd4..c023aed1e9 100644 --- a/src/applications/phame/controller/PhameController.php +++ b/src/applications/phame/controller/PhameController.php @@ -41,7 +41,7 @@ abstract class PhameController extends PhabricatorController { assert_instances_of($posts, 'PhamePost'); $list = id(new PhabricatorObjectItemListView()) - ->setViewer($user) + ->setUser($user) ->setNoDataString($nodata); foreach ($posts as $post) { diff --git a/src/applications/phame/controller/blog/PhameBlogListController.php b/src/applications/phame/controller/blog/PhameBlogListController.php index a6d47343e5..21a00d6c35 100644 --- a/src/applications/phame/controller/blog/PhameBlogListController.php +++ b/src/applications/phame/controller/blog/PhameBlogListController.php @@ -71,7 +71,7 @@ final class PhameBlogListController extends PhameController { $view = new PhabricatorObjectItemListView(); $view->setNoDataString($nodata); - $view->setViewer($user); + $view->setUser($user); foreach ($blogs as $blog) { $item = id(new PhabricatorObjectItemView()) diff --git a/src/applications/phame/skins/PhameBasicBlogSkin.php b/src/applications/phame/skins/PhameBasicBlogSkin.php index 38f1dd9b30..60dea6a467 100644 --- a/src/applications/phame/skins/PhameBasicBlogSkin.php +++ b/src/applications/phame/skins/PhameBasicBlogSkin.php @@ -283,7 +283,7 @@ abstract class PhameBasicBlogSkin extends PhameBlogSkin { $views = array(); foreach ($posts as $post) { $view = id(new PhamePostView()) - ->setViewer($user) + ->setUser($user) ->setSkin($this) ->setPost($post) ->setBody($engine->getOutput($post, PhamePost::MARKUP_FIELD_BODY)) diff --git a/src/applications/phame/view/PhamePostView.php b/src/applications/phame/view/PhamePostView.php index 03f9938d6a..a7c2ac7382 100644 --- a/src/applications/phame/view/PhamePostView.php +++ b/src/applications/phame/view/PhamePostView.php @@ -7,7 +7,6 @@ final class PhamePostView extends AphrontView { private $post; private $author; - private $viewer; private $body; private $skin; private $summary; @@ -22,15 +21,6 @@ final class PhamePostView extends AphrontView { return $this->skin; } - public function setViewer(PhabricatorUser $viewer) { - $this->viewer = $viewer; - return $this; - } - - public function getViewer() { - return $this->viewer; - } - public function setAuthor(PhabricatorObjectHandle $author) { $this->author = $author; return $this; @@ -93,7 +83,7 @@ final class PhamePostView extends AphrontView { 'Published on %s by %s', phabricator_datetime( $this->getPost()->getDatePublished(), - $this->getViewer()), + $this->getUser()), $this->getAuthor()->getName()))); } diff --git a/src/applications/ponder/controller/PonderFeedController.php b/src/applications/ponder/controller/PonderFeedController.php index 84b6d63161..568adfc306 100644 --- a/src/applications/ponder/controller/PonderFeedController.php +++ b/src/applications/ponder/controller/PonderFeedController.php @@ -90,7 +90,7 @@ final class PonderFeedController extends PonderController { $user = $this->getRequest()->getUser(); $view = new PhabricatorObjectItemListView(); - $view->setViewer($user); + $view->setUser($user); $view->setNoDataString(pht('No matching questions.')); foreach ($questions as $question) { $item = new PhabricatorObjectItemView(); diff --git a/src/applications/ponder/view/PonderUserProfileView.php b/src/applications/ponder/view/PonderUserProfileView.php index a465e77606..6c0dbf6115 100644 --- a/src/applications/ponder/view/PonderUserProfileView.php +++ b/src/applications/ponder/view/PonderUserProfileView.php @@ -55,7 +55,7 @@ final class PonderUserProfileView extends AphrontView { $answers = $apagebuttons->sliceResults($answers); $view = new PhabricatorObjectItemListView(); - $view->setViewer($user); + $view->setUser($user); $view->setNoDataString(pht('No matching answers.')); foreach ($answers as $answer) { diff --git a/src/applications/transactions/controller/PhabricatorApplicationTransactionCommentHistoryController.php b/src/applications/transactions/controller/PhabricatorApplicationTransactionCommentHistoryController.php index 7a99f77601..2819f743de 100644 --- a/src/applications/transactions/controller/PhabricatorApplicationTransactionCommentHistoryController.php +++ b/src/applications/transactions/controller/PhabricatorApplicationTransactionCommentHistoryController.php @@ -60,7 +60,7 @@ final class PhabricatorApplicationTransactionCommentHistoryController } $view = id(new PhabricatorApplicationTransactionView()) - ->setViewer($user) + ->setUser($user) ->setTransactions($xactions) ->setShowEditActions(false); diff --git a/src/view/layout/PhabricatorObjectItemListView.php b/src/view/layout/PhabricatorObjectItemListView.php index 1d2dcc94d8..8b5f933d7a 100644 --- a/src/view/layout/PhabricatorObjectItemListView.php +++ b/src/view/layout/PhabricatorObjectItemListView.php @@ -6,16 +6,6 @@ final class PhabricatorObjectItemListView extends AphrontView { private $items; private $pager; private $noDataString; - private $viewer; - - public function setViewer($viewer) { - $this->viewer = $viewer; - return $this; - } - - public function getViewer() { - return $this->viewer; - } public function setHeader($header) { $this->header = $header;