fix PHP 7.3 Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"

This commit is contained in:
Ralf Becker 2018-12-11 12:45:17 +01:00
parent 5a0cd76250
commit 01bd78e34a
6 changed files with 18 additions and 18 deletions

View File

@ -174,7 +174,7 @@ class Select extends Etemplate\Widget
{ {
case 'select-account': case 'select-account':
// If in allowed options, skip account check to support app-specific options // If in allowed options, skip account check to support app-specific options
if(count($allowed) > 0 && in_array($val,$allowed)) continue; if(count($allowed) > 0 && in_array($val, $allowed)) continue 2; // +1 for switch
// validate accounts independent of options know to server // validate accounts independent of options know to server
$account_type = $this->attrs['account_type'] ? $this->attrs['account_type'] : 'accounts'; $account_type = $this->attrs['account_type'] ? $this->attrs['account_type'] : 'accounts';

View File

@ -542,7 +542,7 @@ class calendar_ical extends calendar_boupdate
break; break;
case 'CLASS': case 'CLASS':
if ($event['public']) continue; // public is default, no need to export, fails CalDAVTester if added as default if ($event['public']) continue 2; // public is default, no need to export, fails CalDAVTester if added as default
$attributes['CLASS'] = $event['public'] ? 'PUBLIC' : 'PRIVATE'; $attributes['CLASS'] = $event['public'] ? 'PUBLIC' : 'PRIVATE';
// Apple iCal on OS X uses X-CALENDARSERVER-ACCESS: CONFIDENTIAL on VCALANDAR (not VEVENT!) // Apple iCal on OS X uses X-CALENDARSERVER-ACCESS: CONFIDENTIAL on VCALANDAR (not VEVENT!)
if (!$event['public'] && $this->productManufacturer == 'groupdav') if (!$event['public'] && $this->productManufacturer == 'groupdav')
@ -689,7 +689,7 @@ class calendar_ical extends calendar_boupdate
break; break;
case 'PRIORITY': case 'PRIORITY':
if (!$event['priority']) continue; // 0=undefined is default, no need to export, fails CalDAVTester if our default is added if (!$event['priority']) continue 2; // 0=undefined is default, no need to export, fails CalDAVTester if our default is added
if ($this->productManufacturer == 'funambol' && if ($this->productManufacturer == 'funambol' &&
(strpos($this->productName, 'outlook') !== false (strpos($this->productName, 'outlook') !== false
|| strpos($this->productName, 'pocket pc') !== false)) || strpos($this->productName, 'pocket pc') !== false))
@ -703,7 +703,7 @@ class calendar_ical extends calendar_boupdate
break; break;
case 'TRANSP': case 'TRANSP':
if (!$event['non_blocking']) continue; // OPAQUE is default, no need to export, fails CalDAVTester if added as default if (!$event['non_blocking']) continue 2; // OPAQUE is default, no need to export, fails CalDAVTester if added as default
if ($version == '1.0') if ($version == '1.0')
{ {
$attributes['TRANSP'] = ($event['non_blocking'] ? 1 : 0); $attributes['TRANSP'] = ($event['non_blocking'] ? 1 : 0);
@ -822,7 +822,7 @@ class calendar_ical extends calendar_boupdate
} }
//Horde::logMessage("vCalendar $icalFieldName omitted due to maximum size $size", //Horde::logMessage("vCalendar $icalFieldName omitted due to maximum size $size",
// __FILE__, __LINE__, PEAR_LOG_WARNING); // __FILE__, __LINE__, PEAR_LOG_WARNING);
continue; // skip field continue 2; // skip field
} }
// truncate the value to size // truncate the value to size
$value = substr($value, 0, $size - 1); $value = substr($value, 0, $size - 1);
@ -1301,7 +1301,7 @@ class calendar_ical extends calendar_boupdate
switch ($key) switch ($key)
{ {
case 'participants_types': case 'participants_types':
continue; continue 2; // +1 for switch
case 'participants': case 'participants':
foreach ($event_info['stored_event']['participants'] as $uid => $status) foreach ($event_info['stored_event']['participants'] as $uid => $status)
@ -2848,11 +2848,11 @@ class calendar_ical extends calendar_boupdate
} }
$status = 'U'; // keep the group $status = 'U'; // keep the group
} }
else continue; // can't find this group else continue 2; // can't find this group
} }
elseif (empty($searcharray)) elseif (empty($searcharray))
{ {
continue; // participants without email AND CN --> ignore it continue 2; // participants without email AND CN --> ignore it
} }
elseif ((list($data) = $this->addressbook->search($searcharray, elseif ((list($data) = $this->addressbook->search($searcharray,
array('id','egw_addressbook.account_id as account_id','n_fn'), array('id','egw_addressbook.account_id as account_id','n_fn'),

View File

@ -2888,42 +2888,42 @@ ORDER BY cal_user_type, cal_usre_id
if ($status != 'U') if ($status != 'U')
{ {
unset($participants[$uid]); unset($participants[$uid]);
continue; continue 2; // +1 for switch
} }
break; break;
case 'accepted': case 'accepted':
if ($status != 'A') if ($status != 'A')
{ {
unset($participants[$uid]); unset($participants[$uid]);
continue; continue 2; // +1 for switch
} }
break; break;
case 'tentative': case 'tentative':
if ($status != 'T') if ($status != 'T')
{ {
unset($participants[$uid]); unset($participants[$uid]);
continue; continue 2; // +1 for switch
} }
break; break;
case 'rejected': case 'rejected':
if ($status != 'R') if ($status != 'R')
{ {
unset($participants[$uid]); unset($participants[$uid]);
continue; continue 2; // +1 for switch
} }
break; break;
case 'delegated': case 'delegated':
if ($status != 'D') if ($status != 'D')
{ {
unset($participants[$uid]); unset($participants[$uid]);
continue; continue 2; // +1 for switch
} }
break; break;
case 'default': case 'default':
if ($status == 'R') if ($status == 'R')
{ {
unset($participants[$uid]); unset($participants[$uid]);
continue; continue 2; // +1 for switch
} }
break; break;
default: default:

View File

@ -768,7 +768,7 @@ class calendar_uilist extends calendar_ui
if(!$event) if(!$event)
{ {
$failed++; $failed++;
continue; continue 2; // +1 for switch
} }
$timesheet = array( $timesheet = array(
'ts_title' => $event['title'], 'ts_title' => $event['title'],

View File

@ -2049,7 +2049,7 @@ class infolog_bo
. '()[location mismatch]: ' . '()[location mismatch]: '
. $infoData['info_location'] . ' <> ' . $egwData['info_location']); . $infoData['info_location'] . ' <> ' . $egwData['info_location']);
} }
continue; continue 2; // +1 for switch
} }
default: default:
if (!empty($egwData['info_des'])) if (!empty($egwData['info_des']))
@ -2066,7 +2066,7 @@ class infolog_bo
. '()[description mismatch]: ' . '()[description mismatch]: '
. $infoData['info_des'] . ' <> ' . $egwData['info_des']); . $infoData['info_des'] . ' <> ' . $egwData['info_des']);
} }
continue; continue 2; // +1 for switch
} }
// no further criteria to match // no further criteria to match
$foundInfoLogs[$egwData['info_id']] = $egwData['info_id']; $foundInfoLogs[$egwData['info_id']] = $egwData['info_id'];

View File

@ -852,7 +852,7 @@ class infolog_so
{ {
case 'info_responsible': case 'info_responsible':
$data = (int) $data; $data = (int) $data;
if (!$data) continue; if (!$data) continue 2; // +1 for switch
$filtermethod .= ' AND ('.$this->responsible_filter($data)." OR $this->users_table.account_id IS NULL AND ". $filtermethod .= ' AND ('.$this->responsible_filter($data)." OR $this->users_table.account_id IS NULL AND ".
$this->db->expression($this->info_table,array( $this->db->expression($this->info_table,array(
'info_owner' => $data > 0 ? $data : $GLOBALS['egw']->accounts->members($data,true) 'info_owner' => $data > 0 ? $data : $GLOBALS['egw']->accounts->members($data,true)