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

BAO_Mailing::create - stop passing by reference #22753

Merged
merged 1 commit into from
Feb 17, 2022

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented Feb 11, 2022

Overview

BAO_Mailing::create - stop passing by reference

Before

$params passed to BAO_Mailing::create as a reference

After

Not a reference

Technical Details

We have been removing this pass-by-refs on an ongoing basis. CRUD calls should use
the api but I checked the core calls and none are looking for anything altered in

I only found one extension in universe using the bao create (unsupported) to create mailings and it does not use params afterwards

Comments

We have been removing this pass-by-refs on an ongoing basis. CRUD calls should use
the api but I checked the core calls and none are looking for anything altered in
@civibot
Copy link

civibot bot commented Feb 11, 2022

(Standard links)

@eileenmcnaughton
Copy link
Contributor Author

@colemanw can you check this?

@@ -1470,7 +1470,7 @@ public static function add(&$params, $ids = []) {
* @throws \CRM_Core_Exception
* @throws \CiviCRM_API3_Exception
*/
public static function create(&$params) {
public static function create(array $params) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this seems to work @eileenmcnaughton but some recent experiences had made me wary of retroactively adding type hints to old functions. It has a tendency to make things blow up and I don't really see the benefit.

@colemanw colemanw merged commit b231c84 into civicrm:master Feb 17, 2022
@colemanw colemanw deleted the mail branch February 17, 2022 22:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants