From d19e2155be0bf04146e5cf7a5d441f821a04f98e Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 24 Feb 2014 18:55:19 -0800 Subject: [PATCH] Reuse common getUser() / setUser() in PHUICalendarListView Summary: These methods already exist in AphrontView. The redefinition can sometimes cause this warning: [2014-02-24 18:27:48] ERROR 2048: Declaration of PHUICalendarListView::setUser() should be compatible with AphrontView::setUser(PhabricatorUser $user) at [/INSECURE/devtools/phabricator/src/view/phui/calendar/PHUICalendarListView.php:138] Test Plan: Viewed calendar on profile. Reviewers: chad, btrahan Reviewed By: chad CC: aran Differential Revision: https://secure.phabricator.com/D8329 --- src/view/phui/calendar/PHUICalendarListView.php | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/view/phui/calendar/PHUICalendarListView.php b/src/view/phui/calendar/PHUICalendarListView.php index cd6b41192a..9aa1bf16c9 100644 --- a/src/view/phui/calendar/PHUICalendarListView.php +++ b/src/view/phui/calendar/PHUICalendarListView.php @@ -5,18 +5,11 @@ final class PHUICalendarListView extends AphrontTagView { private $events = array(); private $blankState; - protected $user; - public function addEvent(AphrontCalendarEventView $event) { $this->events[] = $event; return $this; } - public function setUser($user) { - $this->user = $user; - return $this; - } - public function showBlankState($state) { $this->blankState = $state; return $this; @@ -51,7 +44,9 @@ final class PHUICalendarListView extends AphrontTagView { if ($length >= $timespan) { $timelabel = pht('All Day'); } else { - $timelabel = phabricator_time($event->getEpochStart(), $this->user); + $timelabel = phabricator_time( + $event->getEpochStart(), + $this->getUser()); } $dot = phutil_tag( @@ -109,10 +104,10 @@ final class PHUICalendarListView extends AphrontTagView { $length = ($event->getEpochEnd() - $event->getEpochStart()); if ($length >= $timespan) { $tip = pht('%s, Until: %s', $event->getName(), - phabricator_date($event->getEpochEnd(), $this->user)); + phabricator_date($event->getEpochEnd(), $this->getUser())); } else { $tip = pht('%s, Until: %s', $event->getName(), - phabricator_time($event->getEpochEnd(), $this->user)); + phabricator_time($event->getEpochEnd(), $this->getUser())); } $description = $event->getDescription(); -- 2.51.2