(REF) Remove _tagElement dynamic property #25265
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
The
$_tagElement
property was a bit odd. Look at how it was used:Issues with this code:
_tagElement
is being re-written on each iteration of the loop. So$this->_tagElement
will point to the last element of the loop. I can't see how that is useful for anyone? If it was$this->_tagElement[] = ...
then maybe; but it's not&$this
shows how old this code is. If I understand correctly this was required in PHP4 when objects were not passed as reference by default. I checked the hisory of one file and the property was added when the functionality was first developed, not as part of a later ticket.$this->_tagElement
is a dynamic property, which is deprecated in PHP 8.2._tagElement
is written, but never read or used in core.We could add a
@deprecated
annotation to$_tagElement
first, but based on the above I think it's unlikely third-parties are using_tagElement
and I suspect it's safe to just remove.CRM/Contact/Form/Search.php
did specify$_tagElement
explicitly, but as the task classes don't extendCRM_Contact_Form_Search
that doesn't make any sense...With this change no references to
_tagElement
remain in core.