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 mealy-mouthed isset check from params['id'] #23505

Closed

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented May 19, 2022

Overview

Remove isset to clarify that $params['id'] is either a value or NULL

Before

To get to this point

image

the code must pass through this try -catch

image

so we
a) know the array key exists
b) know that it is either NULL or an integer per the return values of $this->lookupContactID

After

Checking for truthy-ness makes it clear that if there is a value it is meaningful (not an empty string for example)

image

Technical Details

Comments

@civibot
Copy link

civibot bot commented May 19, 2022

(Standard links)

@civibot civibot bot added the master label May 19, 2022
@eileenmcnaughton eileenmcnaughton changed the title Remove isset from params['id'] Remove mealy-mouthed isset check from params['id'] May 19, 2022
@eileenmcnaughton
Copy link
Contributor Author

Closing since #23531 will see this out

@eileenmcnaughton eileenmcnaughton deleted the import_match branch May 20, 2022 22:23
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.

1 participant