From bef5754e4676a8a578550b6af24d050a946405eb Mon Sep 17 00:00:00 2001 From: emkael Date: Thu, 3 Nov 2016 23:22:40 +0100 Subject: * more strict function definitions --- app/frontend/controls/AddToFilter.php | 4 +++- app/frontend/controls/CalendarGrid.php | 4 ++-- app/frontend/controls/EventList.php | 6 +++--- app/frontend/controls/EventRepeater.php | 2 +- app/frontend/controls/TimezoneSelect.php | 2 +- 5 files changed, 10 insertions(+), 8 deletions(-) (limited to 'app/frontend/controls') diff --git a/app/frontend/controls/AddToFilter.php b/app/frontend/controls/AddToFilter.php index 9146f3b..0cc56fc 100644 --- a/app/frontend/controls/AddToFilter.php +++ b/app/frontend/controls/AddToFilter.php @@ -2,6 +2,8 @@ Prado::using('System.Web.UI.ActiveControls.TActiveCheckBox'); +Prado::using('Application.user.DbUser'); + class AddToFilter extends UrlBasedCalendarControl { public function setDescription($val) { @@ -28,7 +30,7 @@ class AddToFilter extends UrlBasedCalendarControl { return $this->getControlState('user'); } - public function setUserToManage($user) { + public function setUserToManage(DbUser $user) { $this->setControlState('user', $user); } diff --git a/app/frontend/controls/CalendarGrid.php b/app/frontend/controls/CalendarGrid.php index b168379..ddd17f2 100644 --- a/app/frontend/controls/CalendarGrid.php +++ b/app/frontend/controls/CalendarGrid.php @@ -7,7 +7,7 @@ Prado::using('Application.user.DbUser'); class CalendarGrid extends FacadeTemplateControl { public function setMonth($month) { - $this->setControlState('Month', $month); + $this->setControlState('Month', TPropertyValue::ensureInteger($month)); } public function getMonth() { @@ -15,7 +15,7 @@ class CalendarGrid extends FacadeTemplateControl { } public function setYear($year) { - $this->setControlState('Year', $year); + $this->setControlState('Year', TPropertyValue::ensureInteger($year)); } public function getYear() { diff --git a/app/frontend/controls/EventList.php b/app/frontend/controls/EventList.php index d40e000..ea6150b 100644 --- a/app/frontend/controls/EventList.php +++ b/app/frontend/controls/EventList.php @@ -2,7 +2,7 @@ class EventList extends UrlBasedCalendarControl { - private function _setDate($key, $date) { + private function _setDate(string $key, string $date) { $datetime = new DateTime($date, new DateTimeZone('UTC')); if (!$datetime) { throw new TInvalidDataValueException( @@ -14,7 +14,7 @@ class EventList extends UrlBasedCalendarControl { } public function setDateFrom($date) { - $this->_setDate('DateFrom', $date); + $this->_setDate('DateFrom', TPropertyValue::ensureString($date)); } public function getDateFrom() { @@ -22,7 +22,7 @@ class EventList extends UrlBasedCalendarControl { } public function setDateTo($date) { - $this->_setDate('DateTo', $date); + $this->_setDate('DateTo', TPropertyValue::ensureString($date)); } public function getDateTo() { diff --git a/app/frontend/controls/EventRepeater.php b/app/frontend/controls/EventRepeater.php index 4fb2812..94fec2c 100644 --- a/app/frontend/controls/EventRepeater.php +++ b/app/frontend/controls/EventRepeater.php @@ -4,7 +4,7 @@ Prado::using('Application.web.TemplateControl'); class EventRepeater extends TemplateControl { - public function setEvents($events) { + public function setEvents(array $events) { $this->Events->DataSource = $events; $this->Events->dataBind(); } diff --git a/app/frontend/controls/TimezoneSelect.php b/app/frontend/controls/TimezoneSelect.php index 25af453..5c198a4 100644 --- a/app/frontend/controls/TimezoneSelect.php +++ b/app/frontend/controls/TimezoneSelect.php @@ -44,7 +44,7 @@ class TimezoneSelect extends FacadeTemplateControl { private function _getTimezones() { $timezones = array_map( - function($tz) { + function(string $tz) { return new TimezoneDTO($tz); }, DateTimeZone::listIdentifiers() -- cgit v1.2.3