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

dev/financial#152 Remove unreachable code #18734

Merged
merged 1 commit into from
Oct 11, 2020

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented Oct 11, 2020

Overview

Remove unreachable code

Before

Code chunk exists that is only reachable when $txnType is 'recurring_payment' AND $first is truthy

Screen Shot 2020-10-11 at 1 37 34 PM

BUT there is an early return a little earlier in the function if those conditions are true

Screen Shot 2020-10-11 at 1 39 04 PM

Ergo this code is unreachable - and would have been
since the earlier code switched to using the api to handle non-firsts

After

poof

Technical Details

There is test cover on this function in CRM_Core_Payment_PayPalProIPNTest but it can't actually test code that can't be reached

Comments

This code cann only be reached if txnType is recurring_payment. Given that we can look
at the earlier switch and see that in that case first must be TRUE or it would have
already returned. Ergo this code is unreachable - and would have been
since the earlier code switched to using the api to handle non-firsts
@civibot civibot bot added the master label Oct 11, 2020
@civibot
Copy link

civibot bot commented Oct 11, 2020

(Standard links)

@mattwire mattwire merged commit 2993d17 into civicrm:master Oct 11, 2020
@mattwire
Copy link
Contributor

Agree

@eileenmcnaughton eileenmcnaughton deleted the ppp branch October 11, 2020 20:05
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