summaryrefslogtreecommitdiff
path: root/app/frontend/controls
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2016-11-03 23:22:40 +0100
committeremkael <emkael@tlen.pl>2016-11-03 23:22:40 +0100
commitbef5754e4676a8a578550b6af24d050a946405eb (patch)
tree190a54af236d00c476b28799ba502a42205a95c5 /app/frontend/controls
parent94e03b260197122ae8f6d7dfedfb2a191fdae273 (diff)
* more strict function definitions
Diffstat (limited to 'app/frontend/controls')
-rw-r--r--app/frontend/controls/AddToFilter.php4
-rw-r--r--app/frontend/controls/CalendarGrid.php4
-rw-r--r--app/frontend/controls/EventList.php6
-rw-r--r--app/frontend/controls/EventRepeater.php2
-rw-r--r--app/frontend/controls/TimezoneSelect.php2
5 files changed, 10 insertions, 8 deletions
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()