Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update a few references to list() #26023

Merged
merged 1 commit into from
Apr 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
2 changes: 1 addition & 1 deletion CRM/Activity/Form/Activity.php
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ public function preProcess() {

$activityTypeDescription = NULL;
if ($this->_activityTypeId) {
list($this->_activityTypeName, $activityTypeDescription) = CRM_Core_BAO_OptionValue::getActivityTypeDetails($this->_activityTypeId);
[$this->_activityTypeName, $activityTypeDescription] = CRM_Core_BAO_OptionValue::getActivityTypeDetails($this->_activityTypeId);
}

// Set activity type name and description to template.
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
2 changes: 1 addition & 1 deletion CRM/Activity/Form/Task/AddToTag.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public function postProcess() {
foreach ($allTags as $key => $dnc) {
$this->_name[] = $this->_tags[$key];

list($total, $added, $notAdded) = CRM_Core_BAO_EntityTag::addEntitiesToTag($this->_activityHolderIds, $key,
[, $added, $notAdded] = CRM_Core_BAO_EntityTag::addEntitiesToTag($this->_activityHolderIds, $key,
'civicrm_activity', FALSE);

$status = [ts('Activity tagged', ['count' => $added, 'plural' => '%count activities tagged'])];
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/Selector/Search.php
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ public function &getRows($action, $offset, $rowCount, $sort, $output = NULL) {

$row['target_contact_name'] = CRM_Activity_BAO_ActivityContact::getNames($row['activity_id'], $targetID);
$row['assignee_contact_name'] = CRM_Activity_BAO_ActivityContact::getNames($row['activity_id'], $assigneeID);
list($row['source_contact_name'], $row['source_contact_id']) = CRM_Activity_BAO_ActivityContact::getNames($row['activity_id'], $sourceID, TRUE);
[$row['source_contact_name'], $row['source_contact_id']] = CRM_Activity_BAO_ActivityContact::getNames($row['activity_id'], $sourceID, TRUE);
$row['source_contact_name'] = implode(',', array_values($row['source_contact_name']));
$row['source_contact_id'] = implode(',', $row['source_contact_id']);

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