Use ?: operator

This commit is contained in:
Aleksander Machniak 2019-11-08 09:05:40 +01:00
parent a52e68c07d
commit be07d88150

View file

@ -203,7 +203,7 @@ abstract class kolab_format_xcal extends kolab_format
for ($i=0; $i < $byday->size(); $i++) { for ($i=0; $i < $byday->size(); $i++) {
$daypos = $byday->get($i); $daypos = $byday->get($i);
$prefix = $daypos->occurence(); $prefix = $daypos->occurence();
$weekdays[] = ($prefix ? $prefix : '') . $weekday_map[$daypos->weekday()]; $weekdays[] = ($prefix ?: '') . $weekday_map[$daypos->weekday()];
} }
$object['recurrence']['BYDAY'] = join(',', $weekdays); $object['recurrence']['BYDAY'] = join(',', $weekdays);
} }
@ -382,8 +382,8 @@ abstract class kolab_format_xcal extends kolab_format
$att = new Attendee; $att = new Attendee;
$att->setContact($cr); $att->setContact($cr);
$att->setPartStat($this->part_status_map[$attendee['status']]); $att->setPartStat($this->part_status_map[$attendee['status']]);
$att->setRole($this->role_map[$attendee['role']] ? $this->role_map[$attendee['role']] : kolabformat::Required); $att->setRole($this->role_map[$attendee['role']] ?: kolabformat::Required);
$att->setCutype($this->cutype_map[$attendee['cutype']] ? $this->cutype_map[$attendee['cutype']] : kolabformat::CutypeIndividual); $att->setCutype($this->cutype_map[$attendee['cutype']] ?: kolabformat::CutypeIndividual);
$att->setRSVP((bool)$attendee['rsvp']); $att->setRSVP((bool)$attendee['rsvp']);
if (!empty($attendee['delegated-from'])) { if (!empty($attendee['delegated-from'])) {