Skip to content

Commit

Permalink
Update a few references to list()
Browse files Browse the repository at this point in the history
  • Loading branch information
eileenmcnaughton committed Apr 7, 2023
1 parent 74e043e commit 184ee97
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 9 deletions.
3 changes: 3 additions & 0 deletions CRM/Activity/Controller/Search.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
*/
class CRM_Activity_Controller_Search extends CRM_Core_Controller {

/**
* @var string
*/
protected $entity = 'Activity';

/**
Expand Down
6 changes: 3 additions & 3 deletions CRM/Activity/Form/ActivityLinks.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ public static function commonBuildQuickForm($self) {

foreach ($allTypes as $act) {
$url = 'civicrm/activity/add';
if ($act['name'] == 'Email') {
if ($act['name'] === 'Email') {
if (!CRM_Utils_Mail::validOutBoundMail() || !$contactId) {
continue;
}
list($name, $email, $doNotEmail, $onHold, $isDeceased) = CRM_Contact_BAO_Contact::getContactDetails($contactId);
[, $email, $doNotEmail, , $isDeceased] = CRM_Contact_BAO_Contact::getContactDetails($contactId);
if (!$doNotEmail && $email && !$isDeceased) {
$url = 'civicrm/activity/email/add';
$act['label'] = ts('Send an Email');
Expand All @@ -57,7 +57,7 @@ public static function commonBuildQuickForm($self) {
continue;
}
}
elseif ($act['name'] == 'SMS') {
elseif ($act['name'] === 'SMS') {
if (!$contactId || !CRM_SMS_BAO_Provider::activeProviderCount() || !CRM_Core_Permission::check('send SMS')) {
continue;
}
Expand Down
2 changes: 1 addition & 1 deletion CRM/Activity/Form/ActivityView.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function preProcess() {
CRM_Activity_BAO_Activity::retrieve($params, $defaults);

// Send activity type description to template.
list(, $activityTypeDescription) = CRM_Core_BAO_OptionValue::getActivityTypeDetails($defaults['activity_type_id']);
[, $activityTypeDescription] = CRM_Core_BAO_OptionValue::getActivityTypeDetails($defaults['activity_type_id']);
$this->assign('activityTypeDescription', $activityTypeDescription);

if (!empty($defaults['mailingId'])) {
Expand Down
4 changes: 2 additions & 2 deletions CRM/Activity/Form/Task/RemoveFromTag.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public function postProcess() {
$tagList[$val] = 1;
}
else {
list($label, $tagID) = explode(',', $val);
[, $tagID] = explode(',', $val);
$tagList[$tagID] = 1;
}
}
Expand All @@ -113,7 +113,7 @@ public function postProcess() {
foreach ($allTags as $key => $dnc) {
$this->_name[] = $this->_tags[$key];

list($total, $removed, $notRemoved) = CRM_Core_BAO_EntityTag::removeEntitiesFromTag($this->_activityHolderIds,
[, $removed, $notRemoved] = CRM_Core_BAO_EntityTag::removeEntitiesFromTag($this->_activityHolderIds,
$key, 'civicrm_activity', FALSE);

$status = [
Expand Down
2 changes: 1 addition & 1 deletion CRM/Activity/StateMachine/Search.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function __construct($controller, $action = CRM_Core_Action::NONE) {
$this->_pages = [];

$this->_pages['CRM_Activity_Form_Search'] = NULL;
list($task) = $this->taskName($controller, 'Search');
[$task] = $this->taskName($controller, 'Search');
$this->_task = $task;
foreach ($task as $t) {
$this->_pages[$t] = NULL;
Expand Down
3 changes: 3 additions & 0 deletions CRM/Activity/Task.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
*/
class CRM_Activity_Task extends CRM_Core_Task {

/**
* @var string
*/
public static $objectType = 'activity';

/**
Expand Down
2 changes: 1 addition & 1 deletion CRM/Contact/Form/Search/Criteria.php
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ public static function location(&$form) {
$parseStreetAddress = $addressOptions['street_address_parsing'] ?? 0;
$form->assign('parseStreetAddress', $parseStreetAddress);
foreach ($elements as $name => $v) {
list($title, $attributes, $select, $multiSelect) = $v;
[$title, $attributes, $select, $multiSelect] = $v;

if (in_array($name,
['street_number', 'street_name', 'street_unit']
Expand Down
1 change: 0 additions & 1 deletion tests/phpunit/CRMTraits/PCP/PCPTestTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ trait CRMTraits_PCP_PCPTestTrait {
*
* Create the necessary initial objects for a pcpBlock, then return the
* params needed to create the pcpBlock.
*
*/
public function pcpBlockParams() {
$contribPage = CRM_Core_DAO::createTestObject('CRM_Contribute_DAO_ContributionPage');
Expand Down

0 comments on commit 184ee97

Please sign in to comment.