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

Use php to require an array #19370

Merged
merged 1 commit into from
Jan 12, 2021
Merged

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented Jan 12, 2021

Overview

Removes is_array check in favour of php strict typing

Before

lines of code to check if fileName is an array

After

strict typing

Technical Details

To be clear - there is no reason why it shouldn't be an array - in the bad old days a lot of error handling was put in to help developers who didn't have good debug tools

Comments

Removes is_array check in favour of php strict typing
@civibot
Copy link

civibot bot commented Jan 12, 2021

(Standard links)

@civibot civibot bot added the master label Jan 12, 2021
@demeritcowboy
Copy link
Contributor

This looks good. Giving it a non-array throws a type error instead. It's an error not an exception, but gives the same result just with a different looking screen depending on your error handling settings.

Type error: Argument 1 passed to CRM_Activity_Import_Parser::run() must be of the type array, string given

@colemanw colemanw merged commit 1a93479 into civicrm:master Jan 12, 2021
@colemanw colemanw deleted the cleanup2 branch January 12, 2021 18:55
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.

3 participants