Fix PHP7 warnings in calendar plugin code (Bifrost#T31309)

This commit is contained in:
Aleksander Machniak 2017-05-09 15:13:02 +02:00
parent f30978e288
commit 49bf3288e5
3 changed files with 14 additions and 8 deletions

View file

@ -532,17 +532,18 @@ abstract class calendar_driver
/**
* Get a list of property changes beteen two revisions of an event
*
* @param array $event Hash array with event properties:
* @param array $event Hash array with event properties:
* id: Event identifier
* calendar: Calendar identifier
* @param mixed $rev Revisions: "from:to"
* @param mixed $rev1 Old Revision
* @param mixed $rev2 New Revision
*
* @return array List of property changes, each as a hash array:
* property: Revision number
* old: Old property value
* new: Updated property value
*/
public function get_event_diff($event, $rev)
public function get_event_diff($event, $rev1, $rev2)
{
return false;
}

View file

@ -130,7 +130,7 @@ class kolab_calendar extends kolab_storage_folder_api
/**
* Return color to display this calendar
*/
public function get_color()
public function get_color($default = null)
{
// color is defined in folder METADATA
if ($color = $this->storage->get_color()) {
@ -143,7 +143,7 @@ class kolab_calendar extends kolab_storage_folder_api
if (!empty($prefs[$this->id]) && !empty($prefs[$this->id]['color']))
return $prefs[$this->id]['color'];
return 'cc0000';
return $default ?: 'cc0000';
}
/**

View file

@ -84,9 +84,11 @@ class kolab_user_calendar extends kolab_calendar
/**
* Getter for the IMAP folder owner
*
* @param bool Return a fully qualified owner name (unused)
*
* @return string Name of the folder owner
*/
public function get_owner()
public function get_owner($fully_qualified = false)
{
return $this->userdata['mail'];
}
@ -195,9 +197,11 @@ class kolab_user_calendar extends kolab_calendar
* @param string Search query (optional)
* @param boolean Include virtual events (optional)
* @param array Additional parameters to query storage
* @param array Additional query to filter events
*
* @return array A list of event records
*/
public function list_events($start, $end, $search = null, $virtual = 1, $query = array())
public function list_events($start, $end, $search = null, $virtual = 1, $query = array(), $filter_query = null)
{
// convert to DateTime for comparisons
try {
@ -258,9 +262,10 @@ class kolab_user_calendar extends kolab_calendar
*
* @param integer Date range start (unix timestamp)
* @param integer Date range end (unix timestamp)
* @param array Additional query to filter events
* @return integer Count
*/
public function count_events($start, $end = null)
public function count_events($start, $end = null, $filter_query = null)
{
// not implemented
return 0;