Fixed additional php7 incompatible code + correctly called parent constructors.
authorMattias Michaux <mattias.michaux@gmail.com>
Wed, 25 May 2016 19:20:37 +0000 (21:20 +0200)
committerTim Otten <totten@civicrm.org>
Sat, 30 Jul 2016 02:20:59 +0000 (19:20 -0700)
CRM/Contact/BAO/Query.php
CRM/Core/BAO/RecurringEntity.php
CRM/Core/CodeGen/Main.php
CRM/Core/Controller.php
CRM/Core/Form.php
CRM/Core/Smarty.php
CRM/Financial/BAO/FinancialAccount.php
CRM/Logging/Differ.php
CRM/Report/Form/Extended.php
CRM/Utils/Pager.php

index 4260f828a38e0047d48fbe69089229a1678d2e35..1467ae6eacb4bf55b081ac806ec75147a9e12b61 100644 (file)
@@ -5749,7 +5749,7 @@ AND   displayRelType.is_active = 1
       }
 
       if (is_object($dao) && property_exists($dao, $value['idCol'])) {
-        $val = $dao->$value['idCol'];
+        $val = $dao->{$value['idCol']};
         if ($key == 'groups') {
           $dao->groups = $this->convertGroupIDStringToLabelString($dao, $val);
           return;
@@ -5764,10 +5764,10 @@ AND   displayRelType.is_active = 1
           $dao->$idColumn = $val;
 
           if ($key == 'state_province_name') {
-            $dao->$value['pseudoField'] = $dao->$key = CRM_Core_PseudoConstant::stateProvinceAbbreviation($val);
+            $dao->{$value['pseudoField']} = $dao->$key = CRM_Core_PseudoConstant::stateProvinceAbbreviation($val);
           }
           else {
-            $dao->$value['pseudoField'] = $dao->$key = CRM_Core_PseudoConstant::getLabel($baoName, $value['pseudoField'], $val);
+            $dao->{$value['pseudoField']} = $dao->$key = CRM_Core_PseudoConstant::getLabel($baoName, $value['pseudoField'], $val);
           }
         }
         elseif ($value['pseudoField'] == 'state_province_abbreviation') {
index a200f890f1377b018cfeaaf9adb2da7d7555cc29..1cca84321530ec97f5e2328dc0cde877726dea66 100644 (file)
@@ -842,8 +842,8 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity {
           }
 
           $linkedDao = new $daoName();
-          $linkedDao->$linfo['entity_id_col'] = $entityId;
-          $linkedDao->$linfo['entity_table_col'] = $entityTable;
+          $linkedDao->{$linfo['entity_id_col']} = $entityId;
+          $linkedDao->{$linfo['entity_table_col']} = $entityTable;
           $linkedDao->find();
           while ($linkedDao->fetch()) {
             CRM_Core_BAO_RecurringEntity::delEntity($linkedDao->id, $linkedTable, FALSE);
index 6a5ff43872434aaea74ac1767514fb7573b08681..7d8185034dd85730f9c32826e76b733f8b37bdd5 100644 (file)
@@ -81,7 +81,7 @@ class CRM_Core_CodeGen_Main {
       exit();
     }
 
-    if (substr(phpversion(), 0, 1) != 5) {
+    if (substr(phpversion(), 0, 1) < 5) {
       echo phpversion() . ', ' . substr(phpversion(), 0, 1) . "\n";
       echo "
 CiviCRM requires a PHP Version >= 5
index 73b08a5c48d55cb9ac02369b25f52f18c4310686..51ac453e304f629d176d67dbf80b50edfdbf38ab 100644 (file)
@@ -220,7 +220,7 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller {
       ));
     }
 
-    $this->HTML_QuickForm_Controller($name, $modal);
+    parent::__construct($name, $modal);
 
     $snippet = CRM_Utils_Array::value('snippet', $_REQUEST);
     if ($snippet) {
index 029083d11b5d1a5a5c82cbc1e16a9cc1c88aa674..f85032dd29f0addfa8bf392d488344920fb2171c 100644 (file)
@@ -242,7 +242,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page {
       $this->_name = CRM_Utils_String::getClassName(CRM_Utils_System::getClassName($this));
     }
 
-    $this->HTML_QuickForm_Page($this->_name, $method);
+    parent::__construct($this->_name, $method);
 
     $this->_state =& $state;
     if ($this->_state) {
index 5a3cb1cfa8d7eb35ac1efd01de30fc6df50b835d..83cb9c135d3bbe13dc82821c544e46f5a15feb11 100644 (file)
@@ -82,7 +82,7 @@ class CRM_Core_Smarty extends Smarty {
    *
    * @return CRM_Core_Smarty
    */
-  private function __construct() {
+  public function __construct() {
     parent::__construct();
   }
 
index 2ec3a4db4049766b24af42148ed4881635ab02cd..9e5e1d6b1785e41096104ac83488be90cf64d65d 100644 (file)
@@ -149,7 +149,7 @@ class CRM_Financial_BAO_FinancialAccount extends CRM_Financial_DAO_FinancialAcco
       require_once str_replace('_', DIRECTORY_SEPARATOR, "CRM_" . $name[0] . "_BAO_" . $name[1]) . ".php";
       $className = "CRM_{$name[0]}_BAO_{$name[1]}";
       $bao = new $className();
-      $bao->$name[2] = $financialAccountId;
+      $bao->{$name[2]} = $financialAccountId;
       if ($bao->find(TRUE)) {
         $check = TRUE;
       }
index 2d46a9bf0493d08fd0b7f61989b4931958dd57ac..a6f613031d7f8e45322adaea62d5120a5ba3835d 100644 (file)
@@ -244,7 +244,7 @@ WHERE lt.log_conn_id = %1
         // we need to make sure separators are trimmed
         if ($diff == 'case_type_id') {
           foreach (array('original', 'changed') as $var) {
-            if (!empty($$var[$diff])) {
+            if (!empty(${$var[$diff]})) {
               $holder =& $$var;
               $val = explode(CRM_Case_BAO_Case::VALUE_SEPARATOR, $holder[$diff]);
               $holder[$diff] = CRM_Utils_Array::value(1, $val);
index fe0999dddb48796185254dcee1907716b712854d..92c6fd7481992eaaa046df9257ed9d390a27dbd8 100644 (file)
@@ -171,7 +171,7 @@ class CRM_Report_Form_Extended extends CRM_Report_Form {
     foreach ($rows as $index => & $row) {
       foreach ($row as $selectedfield => $value) {
         if (array_key_exists($selectedfield, $alterfunctions)) {
-          $rows[$index][$selectedfield] = $this->$alterfunctions[$selectedfield]($value, $row, $selectedfield, $altermap[$selectedfield]);
+          $rows[$index][$selectedfield] = $this->{$alterfunctions[$selectedfield]}($value, $row, $selectedfield, $altermap[$selectedfield]);
         }
       }
     }
index ef8cb363603ac9e2733a87a4d434c7cc86e10f39..6b3b2e068daf6d3d016a34240573b03c6662438d 100644 (file)
@@ -75,7 +75,7 @@ class CRM_Utils_Pager extends Pager_Sliding {
 
     $this->initialize($params);
 
-    $this->Pager_Sliding($params);
+    parent::__construct($params);
 
     list($offset, $limit) = $this->getOffsetAndRowCount();
     $start = $offset + 1;