(REF) Tidy up properties in CRM_Core_ResourcesTest #25349
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
basedir
andcontainer
existed as dynamic properties. Aside from dynamic properties being deprecated, these properties were not used._createMapper
took$cache
and$cacheKey
arguments, but nothing that called_createMapper
ever passed in a value.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.