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

(REF) Tidy up properties in CRM_Core_ResourcesTest #25349

Merged
merged 1 commit into from
Jan 16, 2023

Conversation

braders
Copy link
Contributor

@braders braders commented Jan 15, 2023

Overview

This is a general tidy up of CRM_Core_ResourcesTest. The driving motivation is removing dynamic properties for PHP8.2 support, but in this case the refactoring goes slightly further.

Before

  1. basedir and container existed as dynamic properties. Aside from dynamic properties being deprecated, these properties were not used.
  2. _createMapper took $cache and $cacheKey arguments, but nothing that called _createMapper ever passed in a value.
  3. I think many people would argue that the use of list was unnecessary here, and harmed readability.

After

Refactored so that the unneccessary dynamic properties are not created, and tidied up the createMapper function.

Comments

As this is a test there should be no backwards-compat risk to changing createMapper.

$this->mapper is only actually referenced in commented out code. I almost went a step further and made $mapper a local variable, not a property, but I was not sure if it was appropriate to delete the commented out test that referenced $this->mapper, or leave the commented out code pointing to a property that no longer exists.

@civibot
Copy link

civibot bot commented Jan 15, 2023

(Standard links)

@braders
Copy link
Contributor Author

braders commented Jan 16, 2023

Jenkins re test this please

@demeritcowboy demeritcowboy merged commit d126ae0 into civicrm:master Jan 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants