PHP 7.3 continue / break clarification
authorElliott Eggleston <ejegg@ejegg.com>
Thu, 15 Nov 2018 20:22:22 +0000 (15:22 -0500)
committerElliott Eggleston <ejegg@ejegg.com>
Mon, 19 Nov 2018 17:49:18 +0000 (12:49 -0500)
PHP 7.3 started warning on 'continue' statements inside switches,
where they act just like 'break' statements. To actually continue
the enclosing loop, it would have to be 'continue 2'. Since that's
a weird syntax and these two cases have nothing after the switch,
I've replaced them here with break.

CRM/Core/BAO/CustomGroup.php
CRM/Price/BAO/PriceSet.php

index cffdac62c0f416f52e9dbb2758adc3c7f051e4e5..085194fdf5042cdd71fd391c906a57d8d8c2c6c9 100644 (file)
@@ -1564,7 +1564,7 @@ ORDER BY civicrm_custom_group.weight,
 
           case 'File':
             if ($skipFile) {
-              continue;
+              break;
             }
 
             //store the file in d/b
index 922653857d8f5264384f966e71c77ad992266b09..670bb0fb8c16e2fceca22eb171ee0a5f99aac381 100644 (file)
@@ -737,7 +737,7 @@ WHERE  id = %1";
         case 'Radio':
           //special case if user select -none-
           if ($params["price_{$id}"] <= 0) {
-            continue;
+            break;
           }
           $params["price_{$id}"] = array($params["price_{$id}"] => 1);
           $optionValueId = CRM_Utils_Array::key(1, $params["price_{$id}"]);