1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-19 21:32:43 +01:00

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
This commit is contained in:
epriestley 2014-02-24 18:55:19 -08:00
parent 4eadcf975a
commit d19e2155be

View file

@ -5,18 +5,11 @@ final class PHUICalendarListView extends AphrontTagView {
private $events = array(); private $events = array();
private $blankState; private $blankState;
protected $user;
public function addEvent(AphrontCalendarEventView $event) { public function addEvent(AphrontCalendarEventView $event) {
$this->events[] = $event; $this->events[] = $event;
return $this; return $this;
} }
public function setUser($user) {
$this->user = $user;
return $this;
}
public function showBlankState($state) { public function showBlankState($state) {
$this->blankState = $state; $this->blankState = $state;
return $this; return $this;
@ -51,7 +44,9 @@ final class PHUICalendarListView extends AphrontTagView {
if ($length >= $timespan) { if ($length >= $timespan) {
$timelabel = pht('All Day'); $timelabel = pht('All Day');
} else { } else {
$timelabel = phabricator_time($event->getEpochStart(), $this->user); $timelabel = phabricator_time(
$event->getEpochStart(),
$this->getUser());
} }
$dot = phutil_tag( $dot = phutil_tag(
@ -109,10 +104,10 @@ final class PHUICalendarListView extends AphrontTagView {
$length = ($event->getEpochEnd() - $event->getEpochStart()); $length = ($event->getEpochEnd() - $event->getEpochStart());
if ($length >= $timespan) { if ($length >= $timespan) {
$tip = pht('%s, Until: %s', $event->getName(), $tip = pht('%s, Until: %s', $event->getName(),
phabricator_date($event->getEpochEnd(), $this->user)); phabricator_date($event->getEpochEnd(), $this->getUser()));
} else { } else {
$tip = pht('%s, Until: %s', $event->getName(), $tip = pht('%s, Until: %s', $event->getName(),
phabricator_time($event->getEpochEnd(), $this->user)); phabricator_time($event->getEpochEnd(), $this->getUser()));
} }
$description = $event->getDescription(); $description = $event->getDescription();