stable

Clone or download

Read-only

refactor: Reduce MoveChangesetXMLDuckTypingUpdater complexity + optimizations

part story #32280 Complete the "move artifact" feature The methods inside MoveChangesetXMLDuckTypingUpdater were too complex: - Nested loops - Nested if blocks - No usage of the early return pattern It should be easier to understand what it does now. [bonus] I've optimized a few portions of code: 1. We don't iterate over the "not migrateable fields" list anymore for each field change in each chageset in order to know wether we should delete the XML node or we should update it. Now we build a simple list of fields names and verify that the current field name does not appear in this list. 2. To find the destination field in the collection of FieldsMapping, we now make the comparison based on the field name, and not a deep object equality anymore. -- no functional change expectd. Unit test should pass successfully. Change-Id: Ibf48d74611ac5aace9734801b720cdb70fee583b

Modified Files

Name
M plugins/tracker/include/Tracker/XML/Updater/MoveChangesetXMLDuckTypingUpdater.php +44 −21 Go to diff View file