core/3831 Deprecated string interpolation
authorBradley Taylor <hello@brad-taylor.co.uk>
Thu, 1 Sep 2022 15:05:48 +0000 (16:05 +0100)
committerBradley Taylor <hello@brad-taylor.co.uk>
Thu, 1 Sep 2022 15:05:48 +0000 (16:05 +0100)
CRM/Core/CodeGen/Specification.php
CRM/Event/BAO/Participant.php
CRM/Extension/Container/Default.php
CRM/Extension/Downloader.php
CRM/Mailing/BAO/MailingJob.php
CRM/Mailing/BAO/SMSJob.php
CRM/Report/Form/Case/Summary.php
Civi/API/Provider/MagicFunctionProvider.php
tests/phpunit/CRM/Core/Payment/ProcessorFormTest.php
tests/phpunit/CRM/Event/BAO/ChangeFeeSelectionTest.php
tests/phpunit/CRM/Utils/SignerTest.php

index d26f057f9a3cb41e360d6da7079e20131fc8995b..e8b2145c52121f2ad44e6fbb298f2f0212b504bf 100644 (file)
@@ -591,7 +591,7 @@ class CRM_Core_CodeGen_Specification {
     // all fieldnames have to be defined and should exist in schema.
     foreach ($primaryKey['field'] as $fieldName) {
       if (!$fieldName) {
-        echo "Invalid field definition for index '$name' in table ${table['name']}\n";
+        echo "Invalid field definition for index '$name' in table {$table['name']}\n";
         return;
       }
       $parenOffset = strpos($fieldName, '(');
@@ -599,7 +599,7 @@ class CRM_Core_CodeGen_Specification {
         $fieldName = substr($fieldName, 0, $parenOffset);
       }
       if (!array_key_exists($fieldName, $fields)) {
-        echo "Missing definition of field '$fieldName' for index '$name' in table ${table['name']}\n";
+        echo "Missing definition of field '$fieldName' for index '$name' in table {$table['name']}\n";
         print_r($fields);
         exit();
       }
index dbf6edadda8a714c0a00542aa6615b5e1c5853dc..52dd99a99e400c26fb612a63731f2408b2c68295 100644 (file)
@@ -1888,7 +1888,7 @@ WHERE    civicrm_participant.contact_id = {$contactID} AND
     $timenow = new Datetime();
     if (!$isBackOffice && isset($time_limit)) {
       $cancelHours = abs($time_limit);
-      $cancelInterval = new DateInterval("PT${cancelHours}H");
+      $cancelInterval = new DateInterval("PT{$cancelHours}H");
       $cancelInterval->invert = $time_limit < 0 ? 1 : 0;
       $cancelDeadline = (new Datetime($start_date))->sub($cancelInterval);
       if ($timenow > $cancelDeadline) {
index f5a6c4ce3cd686dceeb8bad3d1f98b1b63fb38d4..85bec22c4d5094c1e94813b82076ff03f20e90cd 100644 (file)
@@ -32,7 +32,7 @@ class CRM_Extension_Container_Default extends CRM_Extension_Container_Basic {
     // unless baseDir is set, so this error condition is more theoretical.
     if (empty($this->baseDir) || !is_dir($this->baseDir)) {
       $civicrmDestination = urlencode(CRM_Utils_System::url('civicrm/admin/extensions', 'reset=1'));
-      $url = CRM_Utils_System::url('civicrm/admin/setting/path', "reset=1&civicrmDestination=${civicrmDestination}");
+      $url = CRM_Utils_System::url('civicrm/admin/setting/path', "reset=1&civicrmDestination={$civicrmDestination}");
       $errors[] = array(
         'title' => ts('Invalid Base Directory'),
         'message' => ts('The extensions directory is not properly set. Please go to the <a href="%1">path setting page</a> and correct it.<br/>',
@@ -44,7 +44,7 @@ class CRM_Extension_Container_Default extends CRM_Extension_Container_Basic {
     }
     if (empty($this->baseUrl)) {
       $civicrmDestination = urlencode(CRM_Utils_System::url('civicrm/admin/extensions', 'reset=1'));
-      $url = CRM_Utils_System::url('civicrm/admin/setting/url', "reset=1&civicrmDestination=${civicrmDestination}");
+      $url = CRM_Utils_System::url('civicrm/admin/setting/url', "reset=1&civicrmDestination={$civicrmDestination}");
       $errors[] = array(
         'title' => ts('Invalid Base URL'),
         'message' => ts('The extensions URL is not properly set. Please go to the <a href="%1">URL setting page</a> and correct it.<br/>',
index 4b472267af615dd0c680311681018374525d1df7..c8ac0681cc238429105c3f7c58f0f9fcaf8092e9 100644 (file)
@@ -73,7 +73,7 @@ class CRM_Extension_Downloader {
 
     if (!$this->containerDir || !is_dir($this->containerDir) || !is_writable($this->containerDir)) {
       $civicrmDestination = urlencode(CRM_Utils_System::url('civicrm/admin/extensions', 'reset=1'));
-      $url = CRM_Utils_System::url('civicrm/admin/setting/path', "reset=1&civicrmDestination=${civicrmDestination}");
+      $url = CRM_Utils_System::url('civicrm/admin/setting/path', "reset=1&civicrmDestination={$civicrmDestination}");
       $errors[] = array(
         'title' => ts('Directory Unwritable'),
         'message' => ts("Your extensions directory is not set or is not writable. Click <a href='%1'>here</a> to set the extensions directory.",
index 6457ba2c673ccc7eb24c720711fe991837bffe72..5127e1cecdf0cffbf9d3b0c257360e79f16d020d 100644 (file)
@@ -685,7 +685,7 @@ VALUES (%1, %2, %3, %4, %5, %6, %7)
         // Handle SMS errors: CRM-15426
         $job_id = intval($this->id);
         $mailing_id = intval($mailing->id);
-        CRM_Core_Error::debug_log_message("Failed to send SMS message. Vars: mailing_id: ${mailing_id}, job_id: ${job_id}. Error message follows.");
+        CRM_Core_Error::debug_log_message("Failed to send SMS message. Vars: mailing_id: {$mailing_id}, job_id: {$job_id}. Error message follows.");
         CRM_Core_Error::debug_log_message($result->getMessage());
       }
       else {
index d558d49e3543b800261fe31bd94e6594a5706de0..1f25c11939bb5e14b0f0edcca3de61e81693d49f 100644 (file)
@@ -78,7 +78,7 @@ class CRM_Mailing_BAO_SMSJob extends CRM_Mailing_BAO_MailingJob {
         // Handle SMS errors: CRM-15426
         $job_id = (int) $this->id;
         $mailing_id = (int) $mailing->id;
-        CRM_Core_Error::debug_log_message("Failed to send SMS message. Vars: mailing_id: ${mailing_id}, job_id: ${job_id}. Error message follows.");
+        CRM_Core_Error::debug_log_message("Failed to send SMS message. Vars: mailing_id: {$mailing_id}, job_id: {$job_id}. Error message follows.");
         CRM_Core_Error::debug_log_message($e->getMessage());
       }
 
index 7f2114988d86d837d843f517283267583ac70963..64f8a3173ac1d95bdeb9e4b3354f928040d4f29a 100644 (file)
@@ -267,18 +267,18 @@ class CRM_Report_Form_Case_Summary extends CRM_Report_Form {
     if ($this->_relField) {
       $this->_from = "
             FROM civicrm_contact $c
-inner join civicrm_relationship $cr on {$c}.id = ${cr}.contact_id_b OR {$c}.id = ${cr}.contact_id_a
-inner join civicrm_case $cc on ${cc}.id = ${cr}.case_id
-inner join civicrm_relationship_type $crt on ${crt}.id=${cr}.relationship_type_id
-inner join civicrm_case_contact $ccc on ${ccc}.case_id = ${cc}.id
-inner join civicrm_contact $c2 on ${c2}.id=${ccc}.contact_id
+inner join civicrm_relationship $cr on {$c}.id = {$cr}.contact_id_b OR {$c}.id = {$cr}.contact_id_a
+inner join civicrm_case $cc on {$cc}.id = {$cr}.case_id
+inner join civicrm_relationship_type $crt on {$crt}.id={$cr}.relationship_type_id
+inner join civicrm_case_contact $ccc on {$ccc}.case_id = {$cc}.id
+inner join civicrm_contact $c2 on {$c2}.id={$ccc}.contact_id
 ";
     }
     else {
       $this->_from = "
             FROM civicrm_case $cc
-inner join civicrm_case_contact $ccc on ${ccc}.case_id = ${cc}.id
-inner join civicrm_contact $c2 on ${c2}.id=${ccc}.contact_id
+inner join civicrm_case_contact $ccc on {$ccc}.case_id = {$cc}.id
+inner join civicrm_contact $c2 on {$c2}.id={$ccc}.contact_id
 ";
     }
   }
index e7529b335601afd5907b3a11981efba52b3bef27..8ddcf017cd8f7cd2f4cef745014e9a26b298f0f6 100644 (file)
@@ -284,7 +284,7 @@ class MagicFunctionProvider implements EventSubscriberInterface, ProviderInterfa
     foreach ($include_dirs as $include_dir) {
       foreach ([$camelName, 'Generic'] as $name) {
         $action_dir = implode(DIRECTORY_SEPARATOR,
-          [$include_dir, 'api', "v${version}", $name]);
+          [$include_dir, 'api', "v{$version}", $name]);
         // see note above in getEntityNames about open_basedir
         if (!\CRM_Utils_File::isDir($action_dir)) {
           continue;
index ce391b488d8d90043aa9c31735bc0e0cc1339fe1..9331f94d3e5000855b52820c0183ae7d28190b03 100644 (file)
@@ -83,7 +83,7 @@ class CRM_Core_Payment_ProcessorFormTest extends CiviUnitTestCase {
     $profile = $this->callAPISuccess('UFGroup', 'create', [
       'group_type' => 'Contact',
       'title' => "Billing fields: $name",
-      'name' => "${name}_billing",
+      'name' => "{$name}_billing",
     ]);
 
     $this->callAPISuccess('UFField', 'create', [
index bb3d248e39245a72be5601bd2d10532208fb6fac..d5c833f2bfe321576bec908d47dcbe929cbe3b04 100644 (file)
@@ -203,7 +203,7 @@ class CRM_Event_BAO_ChangeFeeSelectionTest extends CiviUnitTestCase {
       SELECT SUM(fi.amount) total
       FROM civicrm_financial_item fi
         INNER JOIN civicrm_line_item li ON li.id = fi.entity_id AND fi.entity_table = 'civicrm_line_item'
-      WHERE li.entity_table = 'civicrm_participant' AND li.entity_id = ${participantId}
+      WHERE li.entity_table = 'civicrm_participant' AND li.entity_id = {$participantId}
     ";
     $dao = CRM_Core_DAO::executeQuery($query);
 
index 687139568a72f9e454ed6c23de0b1d8b4ab61660..5280a6c0a77744df397d43fda9fcef8e8f9535e0 100644 (file)
@@ -134,7 +134,7 @@ class CRM_Utils_SignerTest extends CiviUnitTestCase {
       $isValid = $validator->validate($signature, $case['validateParams']);
 
       if ($isValid !== $case['isValid']) {
-        $this->fail("Case ${caseId}: Mismatch: " . var_export($case, TRUE));
+        $this->fail("Case {$caseId}: Mismatch: " . var_export($case, TRUE));
       }
       $this->assertTrue(TRUE, 'Validation yielded expected result');
     }