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

Remove-single-value-loop #23155

Merged
merged 1 commit into from
Apr 11, 2022
Merged

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented Apr 10, 2022

Overview

Remove-single-value-loop

Before

 $communicationType = [
      'address' => ['customData' => 1],
    ];
foreach ($communicationType as $key => $value) {
...

  if (isset($value['customData'])) {


After

For each loop removed

Technical Details

The communicationType array only has one value. This removes the foreach, swapping
the values for the only value they could be. This resulted in 2 always-true
ifs being replaced too

  • this is follow on tidy up to a PR @demeritcowboy merged & looks worse than it is due to indentation changes

Comments

The communicationType array only has one value. This removes the foreach, swapping
the values for the only value they could be. This resulted in 2 always-true
ifs being replaced too
@civibot civibot bot added the master label Apr 10, 2022
@civibot
Copy link

civibot bot commented Apr 10, 2022

(Standard links)

@demeritcowboy demeritcowboy merged commit e5c7de6 into civicrm:master Apr 11, 2022
@eileenmcnaughton eileenmcnaughton deleted the ret2 branch April 11, 2022 19:32
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