1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 08:52:39 +01:00

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
This commit is contained in:
vrana 2012-12-20 14:48:23 -08:00
parent 9c27c7ab60
commit 96e5264f05
12 changed files with 11 additions and 37 deletions

View file

@ -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 = '';
}

View file

@ -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();

View file

@ -56,7 +56,7 @@ final class PhabricatorMacroViewController
$engine->process();
$timeline = id(new PhabricatorApplicationTransactionView())
->setViewer($user)
->setUser($user)
->setTransactions($xactions)
->setMarkupEngine($engine);

View file

@ -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();

View file

@ -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) {

View file

@ -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())

View file

@ -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))

View file

@ -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())));
}

View file

@ -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();

View file

@ -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) {

View file

@ -60,7 +60,7 @@ final class PhabricatorApplicationTransactionCommentHistoryController
}
$view = id(new PhabricatorApplicationTransactionView())
->setViewer($user)
->setUser($user)
->setTransactions($xactions)
->setShowEditActions(false);

View file

@ -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;