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 unreachable code (since 2020) #25268

Merged
merged 1 commit into from
Jan 3, 2023

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented Jan 2, 2023

Overview

Remove unreachable code (since 2020)

Before

This function MUST return an array due to the type hint

image

The last few lines of the code (after the last return has failed) do not return anything - so they will always cause a fatal error & never work. The earlier code suggests it should be unreachable & 2 years of no reports of this error confirms

image

After

For clarity the unreachable function call is replaced with an exception

Technical Details

CRM_Contribute_BAO_ContributionPage::sendMail is toxic so less calls to it = better

Comments

@civibot
Copy link

civibot bot commented Jan 2, 2023

(Standard links)

@yashodha
Copy link
Contributor

yashodha commented Jan 3, 2023

@eileenmcnaughton merging this

@eileenmcnaughton
Copy link
Contributor Author

thanks @yashodha - did you mean to merge already?

@yashodha yashodha merged commit f4ab9fb into civicrm:master Jan 3, 2023
@yashodha
Copy link
Contributor

yashodha commented Jan 3, 2023

@eileenmcnaughton oops, I thought I did!

@eileenmcnaughton
Copy link
Contributor Author

:-)

@eileenmcnaughton eileenmcnaughton deleted the is_separate branch January 3, 2023 19:18
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