(NFC) CRM/Upgrade - Autoformat `list()` statements
authorTim Otten <totten@civicrm.org>
Fri, 26 Aug 2022 21:39:10 +0000 (14:39 -0700)
committerTim Otten <totten@civicrm.org>
Fri, 26 Aug 2022 21:41:23 +0000 (14:41 -0700)
CRM/Upgrade/Form.php
CRM/Upgrade/Headless.php
CRM/Upgrade/Incremental/php/FiveTwenty.php
CRM/Upgrade/Incremental/php/FiveTwentyNine.php
CRM/Upgrade/Incremental/php/FourSeven.php
CRM/Upgrade/Page/Upgrade.php

index 78c31d750186e0c4b58b0ba72dc6c4f833afddca..1fb14e1aa819183aac409d7dcd9bd794f4633d43 100644 (file)
@@ -787,7 +787,7 @@ SET    version = '$version'
     $restore = \CRM_Upgrade_DispatchPolicy::useTemporarily('upgrade.finish');
 
     $upgrade = new CRM_Upgrade_Form();
-    list($ignore, $latestVer) = $upgrade->getUpgradeVersions();
+    [$ignore, $latestVer] = $upgrade->getUpgradeVersions();
     // Seems extraneous in context, but we'll preserve old behavior
     $upgrade->setVersion($latestVer);
     // Going forward, any new tasks will run in `upgrade.finish` mode.
index 6bd63d32ddd26831d436f899d6956070f2b3955e..44dca076c91657e18b509ab82b2aa6c16f1e33e2 100644 (file)
@@ -28,7 +28,7 @@ class CRM_Upgrade_Headless {
     set_time_limit(0);
 
     $upgrade = new CRM_Upgrade_Form();
-    list($currentVer, $latestVer) = $upgrade->getUpgradeVersions();
+    [$currentVer, $latestVer] = $upgrade->getUpgradeVersions();
 
     if ($error = $upgrade->checkUpgradeableVersion($currentVer, $latestVer)) {
       throw new Exception($error);
index 1edbef463cd71e3cf98867c6cbbdb4f2ca6921f8..c88ec4be86cc24c8aab0bae44c4dafed6c780e79 100644 (file)
@@ -130,7 +130,7 @@ class CRM_Upgrade_Incremental_php_FiveTwenty extends CRM_Upgrade_Incremental_Bas
         continue;
       }
       // parse out existing id and direction
-      list($relationshipTypeId, $direction1) = explode('_', $match);
+      [$relationshipTypeId, $direction1] = explode('_', $match);
       // we only care about ones that are b_a
       if ($direction1 === 'b') {
         // we only care about bidirectional
index de6ffb7808b001a9ff4a717c3e19dac39ef8e56c..b862968647460e2e82606716964bfae6fb9b7087 100644 (file)
@@ -42,7 +42,7 @@ class CRM_Upgrade_Incremental_php_FiveTwentyNine extends CRM_Upgrade_Incremental
     $this->addTask(ts('Upgrade DB to %1: SQL', [1 => $rev]), 'runSql', $rev);
     $this->addTask('Install eventcart extension', 'installEventCart');
 
-    list($minId, $maxId) = CRM_Core_DAO::executeQuery("SELECT coalesce(min(id),0), coalesce(max(id),0)
+    [$minId, $maxId] = CRM_Core_DAO::executeQuery("SELECT coalesce(min(id),0), coalesce(max(id),0)
       FROM civicrm_relationship ")->getDatabaseResult()->fetchRow();
     for ($startId = $minId; $startId <= $maxId; $startId += self::BATCH_SIZE) {
       $endId = $startId + self::BATCH_SIZE - 1;
index c4affbe683541d87e7634e9e73f4af4bf0805e1f..71f6d29712e69ce00a5863ce8eff35c169317f80 100644 (file)
@@ -457,7 +457,7 @@ class CRM_Upgrade_Incremental_php_FourSeven extends CRM_Upgrade_Incremental_Base
     // CRM-20868 : Update invoice_numbers (in batch) with value in [invoice prefix][contribution id] format
     $contributionSettings = Civi::settings()->get('contribution_invoice_settings');
     if (!empty($contributionSettings['invoicing']) && !empty($contributionSettings['invoice_prefix'])) {
-      list($minId, $maxId) = CRM_Core_DAO::executeQuery("SELECT coalesce(min(id),0), coalesce(max(id),0)
+      [$minId, $maxId] = CRM_Core_DAO::executeQuery("SELECT coalesce(min(id),0), coalesce(max(id),0)
       FROM civicrm_contribution ")->getDatabaseResult()->fetchRow();
       for ($startId = $minId; $startId <= $maxId; $startId += self::BATCH_SIZE) {
         $endId = $startId + self::BATCH_SIZE - 1;
index f96874efcdc1df7f04ef0f1452ee6f96b3d1e801..d1b5e2610b27d8504ec1a5114410c98db7cd8b8c 100644 (file)
@@ -27,7 +27,7 @@ class CRM_Upgrade_Page_Upgrade extends CRM_Core_Page {
     Civi::resources()->addStyleFile('civicrm', 'css/admin.css');
 
     $upgrade = new CRM_Upgrade_Form();
-    list($currentVer, $latestVer) = $upgrade->getUpgradeVersions();
+    [$currentVer, $latestVer] = $upgrade->getUpgradeVersions();
 
     CRM_Utils_System::setTitle(ts('Upgrade CiviCRM to Version %1',
       [1 => $latestVer]
@@ -66,7 +66,7 @@ class CRM_Upgrade_Page_Upgrade extends CRM_Core_Page {
   public function runIntro() {
     $upgrade = new CRM_Upgrade_Form();
     $template = CRM_Core_Smarty::singleton();
-    list($currentVer, $latestVer) = $upgrade->getUpgradeVersions();
+    [$currentVer, $latestVer] = $upgrade->getUpgradeVersions();
     CRM_Core_Smarty::singleton()->assign('sid', CRM_Utils_System::getSiteID());
     // Show success msg if db already upgraded
     if (version_compare($currentVer, $latestVer) == 0) {
@@ -121,7 +121,7 @@ class CRM_Upgrade_Page_Upgrade extends CRM_Core_Page {
    */
   public function runBegin() {
     $upgrade = new CRM_Upgrade_Form();
-    list($currentVer, $latestVer) = $upgrade->getUpgradeVersions();
+    [$currentVer, $latestVer] = $upgrade->getUpgradeVersions();
 
     if ($error = $upgrade->checkUpgradeableVersion($currentVer, $latestVer)) {
       throw new CRM_Core_Exception($error);
@@ -175,7 +175,7 @@ class CRM_Upgrade_Page_Upgrade extends CRM_Core_Page {
     }
 
     // do a version check - after doFinish() sets the final version
-    list($currentVer, $latestVer) = $upgrade->getUpgradeVersions();
+    [$currentVer, $latestVer] = $upgrade->getUpgradeVersions();
     if ($error = $upgrade->checkCurrentVersion($currentVer, $latestVer)) {
       throw new CRM_Core_Exception($error);
     }